I know this question was asked before but I have the following simple code which is not working in IE / MOZILLA
This is a simple script where I am trying to sort out a problem I had.
see code below
<script type="text/javascript">
$(document).ready(function () {
alert('hi');
});
$('.target').change(function () {
alert('Handler for .change() called.');
});
</script>
Index</h2>
<p>
<form action="/Review" method="post"> <select class="target">
<option value="option1" selected="selected">Option 1</option>
<option value="option2">Option 2</option>
</select>
You need to move the
.changebinding up into the$(document).ready()or it will run before there is anything in the DOM that matches your.targetselector: