Script needs to be below ID's
Following code
will not work
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
- <script type="text/javascript">
- $('#jQ').click(function() {
- alert('Handler for .click() called.');
- });
- </script>
- <input type="button" value="jQuery" id="jQ">
However this works
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
- <input type="button" value="jQuery" id="jQ">
- <script type="text/javascript">
- $('#jQ').click(function() {
- alert('Handler for .click() called.');
- });
- </script>
I tried it on google chrome and firefox 3.6.13
Any fixes?