I want to trigger a click on a div on page load, but which div depends on the url.
E.g. HTML
<div id="1" class="clickMe"></div>
<div id="2" class="clickMe"></div>
<div id="3" class="clickMe"></div>
<div id="4" class="clickMe"></div>
A page URL might be:
http://this-site.com/pageName?thing=2
On this occasion I would want to trigger a click on div with class clickMe
, with id=2
I know I can use $( ".clickMe" ).trigger( "click" );
but is there a way to select the div clickMe
that I want?