 <p>The fact that it is hidden changes nothing. The problem is probably that the js code is before the button HTML. Either put it after, or put it in a listener like <code>$(document).ready()</code> to make sure it has been processed when your try to access it.</p>