hguser hguser - 2 years ago 101
jQuery Question

click or change event on radio using jquery

I have some radios in my page,and I want to do something when the checked radio changes,however the code does not work in IE:


And after googling,people suggest use the click instead. But it does not work.

This is the example code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">

<input type="radio" name="testGroup" id="test1" />test1<br/>
<input type="radio" name="testGroup" id="test2" />test2<br/>
<input type="radio" name="testGroup" id="test3" />test3</br>

It also does not work in IE.

So I want to know what is going on?

Also I am afraid if it will retrigger the change event if I click a checked radio?


I can not add comment,so I reply here.

I use IE8 and the link Furqan give me also does not work in IE8. I do not know why...

Answer Source

works for me:





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download