So I have this code that should listen for a click on #button but it won’t work, and is driving me crazy!
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$('#button').click(function() {
alert('OK!');
});
</script>
and the HTML:
<input id="button" type="button" value="OK" />
This is strange. Any help is welcome!
Write your code inside document.ready function
hope you get some idea from this