Question: I have the following in my view:

```
<%=Html.RadioButton("optAll", "1", true)%> &nbsp Choose All
<br />
<%=Html.RadioButton("optAll", "2", false)%> &nbsp Choose Specific

```

Follows is the jquery:

```
$("#optAll").click(function () {
       alert ("Hitting the click function");
    });

```

The problem is that the alert only pops up when the "Choose All" radio button is clicked. It does not pop up when the "Choose Specific" radio button is clicked.

The following kind of works:

```
$(":input[@name='optAll']").change(function () {
       alert ("Hitting the click function");
    });

```

but this solution triggers the message when check boxes on the same page are clicked.

I've also tried the following with no luck:

```
$("#optAll").click(function () {
       alert ("Hitting the click function");
    });

```

Answer: 
try this:

```
$("input[name='optAll']").click(function () {
                alert("Hitting the click function");
            });

```
Your existing Markup looks like this:

```
<%=Html.RadioButton("optAll", "1", true)%> &nbsp Choose All
<br />
<%=Html.RadioButton("optAll", "2", false)%> &nbsp Choose Specific

```

You need to change it so each has it's own seperate class that jQuery can see, so I would reccomend using HTML itself rather than ASP to generate the radio buttons for you. Do this through the following:

```
<input class="radioButtons" type="radio" name="optAll" value="all" /> &nbsp Choose All <br />
<input class="radioButtons" type="radio" name="optAll" value="specific" /> &nbsp Choose Specific

```

Now change the jQuery so that it becomes this:

```
$(".radioButtons").click(function () {
   alert ("Hitting the click function");
});

```