The click method (when using jquery ) fires click events that you register using el.click(function.. and el.on('click', function...
You can create a new MouseEvent and send it directly to the corresponding element:
e = document.createEvent('MouseEvents'); e.initEvent("click", true, true); $('a[href="#hash"]')[0].dispatchEvent(e)
The above code will work in Chrome, Firefox and IE
Or just use the click event for the element (which will not use the jquery click function, but the browser function click ):
$('a[href="#hash"]')[0].click()
Please note that this code may not work in multiple browsers due to security concerns.
Dekel source share