Simple jquery and input text onchange

Simple jquery and input text onchange

Hi all,

I have spent far too much trying to get a simple jquery and input box example to work.

When someone finishes typing something into the input box, i want jquery to popup an alert. Eventually I will be doing some more code with this but right now i just want to get this working!

Here is my example, which doesn't seem to work:

<!DOCTYPE html>
<html>
<head>
<script src=" http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$('#selector').change(function () {
    alert($('#selector').val());
});
</script>
 

</head>
<body>
 
<input type="text" id="selector">

</body>
</html>

Any ideas?

Many thanks