I’m fairly stuck. Trying to learn and practice some basic JQuery and failing miserably. The onchange event just won’t work. Any ideas why this seemingly simply thing won’t fire? The Jquery reference is there when I look in chrome dev tools. Appreciate the help.
<html>
<head>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type='javascript'>
$(document).ready(function(){
$("#groups").change(function(){
alert("hi");
});
});
</script>
</head>
<body>
<form id="select_form">
Select Group to Review:<br />
<select id="groups" class ="groups">
<option value="0">Select Group</option><option value="1">GoTeam</option> </select>
<br /><br />
<input type="submit" value="confirm" />
</form>
<div id="result"></div>
</body>
</html>
It’s not liking your script type. Use the following instead:
Or place it in a spearate file.
See it failing here: http://jsfiddle.net/uajDB/1/
And then working here http://jsfiddle.net/uajDB/