I am learning jquery and I am having difficulty to run the following extremely simple code.
My HTML looks like:
<html>
<head>
<title>JQUERY</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<input type="button" id="testbutton" value="test" />
</body>
My script.js looks like this:
$(document).ready(function(){
alert('document is ready');
});
$('#testbutton').click(function(){
alert('button clicked');
});
when I load the page in browser ... I get the first alert when the document is loaded (so I am sure that I am atleast using the correct library and it is getting downloaded etc).
However when I click my button I do not see the second alert that says "button has been clicked"
What am I missing??