,

Jquery onchange method cross browser

Fix .onchange() problem with .bind()

Not working in Internet Explorer? Use .bind()!

Cross-browser solution File:ie-icon.png File:firefox-icon.png

<script type="text/javascript">

$('#select_field_id').bind("change", function(){loadNewsField();});

</script>

Firefox only solution File:firefox-icon.png

<script type="text/javascript">

$('#select_field_id').attr("onchange","loadNewsField();");

</script>


  • attr() method from the example above: Attributes are elements that you use to add values to HTML tags and DOM elements. onChange() is one of them.


Use .bind()


$('#select_field_id').bind("change", function(){loadNewsField();});