This tutorial uses the default Primary menu items with anchor links to show the anchor links on the browser address bar.
You can add the following code to the WP Dashboard > Divi > Theme Options > Integration Tab > Add code to the <head> section option:
<script class="et_fb_ignore">
jQuery( document ).ready(function() {
jQuery('#top-menu a[href*="#"]').click(function(){
let hash = jQuery(this).attr('href').split('#')[1];
if (hash > 0){
window.location.hash = hash;
}
});
});
</script>
For the same, if you want it for other places, not for the primary menu, you can replace the selector in the jQuery #top-menu a
to your choice CSS selector.
Or if you are looking for universal through any content then you can use this script:
<script class="et_fb_ignore">
jQuery( document ).ready(function() {
jQuery('a[href*="#"]').click(function(){
let hash = jQuery(this).attr('href');
if(hash != "#") {
setTimeout(function(){ location.hash = hash;},800);
}
});
});
</script>