Activate function based on URL rather than click : <p>I have a toggle function that scrolls the page to a section and opens a tab, based on a click on the left side nav (based the id of the link):</p>

<pre><code>&lt;script&gt;
$(document).ready(function(){

//Hide (Collapse) the toggle containers on load
$(".toggle_container3").hide();

//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
$(".trigger3").click(function(){
    $(this).toggleClass("active").next().slideToggle("slow");
    return false; //Prevent the browser jump to the link anchor
}).first().click()      
});
&lt;/script&gt;

&lt;script type="text/javascript"&gt;
$(document).ready(function() {
$("#over_left a").click(function(){
var id = $(this).attr("href");
$(id).addClass("active").next().show("slow");
})
});
&lt;/script&gt;
</code></pre>

<p>Instead of the click being the trigger, I'd like the same loaded URL be the trigger. So, if <a href="https://www.sea.edu/sea_research/climate_change#news" rel="nofollow noreferrer">https://www.sea.edu/sea_research/climate_change#news</a> would also scroll to the News tab and open it (change the class to active) just like the link on the page does. It can be the same tab ID each time - for now only one tab on each page needs to have this treatment.</p>

<p>I don't know what to search for, but something like:</p>

<pre><code> $("URL#news").onload{function()
</code></pre>
