Bear with me as I am new to web development, I was working on a web based application and noticed that even simple JavaScripts were not running on my JSP page. I am trying to implement something similar to this: http://jsfiddle.net/chriscoyier/bphze/76/ I even created a fresh new project to make sure the problem isn't with my code. Here is that fresh page:
<html>
<script type="text/javascript">
<!--
//JavaScript goes here
var checkboxes = $("input[type='checkbox']"),
submitButt = $("input[type='submit']");
checkboxes.click(function() {
submitButt.attr("disabled", !checkboxes.is(":checked"));
});
//-->
</script>
<h1>Button should be enabled if at least one checkbox is checked</h1>
<form>
<div>
<input type="checkbox" name="option-1" id="option-1"> <label for="option-1">Option 1</label>
</div>
<div>
<input type="checkbox" name="option-2" id="option-2"> <label for="option-2">Option 2</label>
</div>
<div>
<input type="checkbox" name="option-3" id="option-3"> <label for="option-3">Option 3</label>
</div>
<div>
<input type="submit" value="Do thing" disabled>
</div>
</form>
</html>
Even a code as simple as the one above isn't executing. What am I missing here ?, do I need to import something into my project files ? Please advise, I am using NetBeans, and running the project on Firefox.