So I have a page that has 3 buttons to filter content on the page.
<section class="solution-filter">
<div class="wrapper">
<button class="fact-sheet" data-target_category="fact-sheet" disabled="">Fact sheet</button>
<button class="demo" data-target_category="demo">Demo</button>
<button class="apps" data-target_category="apps">Apps and connectors</button>
</div><!-- /.wrapper -->
</section>
I would like to be able to perform a click on a button depending on the url hash.
For example http://example.com/#demo
would perform a click on the <button class="demo" data-target_category="demo">Demo</button>
if ( window.location.hash ) {
$(document).click($('<button>').data('target_category', (window.location.hash));
}
hashchangeevent ?