Suppose I have an anchor in my page like :turn to header then I also set a button in my page
turn to header
Please see this answer.
Instead of trying to trigger the click event, try setting the window.location property:
click
window.location
window.location = '#header';
Or perhaps:
$("input").click(function() { window.location = $('#anchor').attr('href'); });