change function not working. Is there a problem with my setup ?
Hi, I'm having problem getting a response from some radio buttons. This is my code
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function() {
-
- $("input[@name='rdio']").change(function() {
- alert('caca');
- });
- });
- });
- </script>
- </head>
- <body>
- <div id="testdiv" class="testdiv">
- <form id='form'>
- <fieldset>
- <input type='radio' name='rdio' value='1' checked='checked'>1</input>
- <input type='radio' name='rdio' value='2'>2</input>
- </fieldset>
- </form>
- <a href="" class="test" id="test">Link</a>
- </div>
- </body>
- </html>
As I understand, whenever I switch the radio buttons from 1 to 2 I should get an alert. I never get it. I've tried this in chrome and and firefox.I haven't had other issues with jquery. Am I doing this wrong or is there an issue with my setup ? I have a standard wamp setup if it helps
Thank you
Sherban