jquery, radio buttons, .html

jquery, radio buttons, .html

I'm working with the following script but have clearly done something wrong.

I would expect "Select something." to show up initially in the #message div and then to be replace by something like "add_gallery button checked" as appropriate for the radio button selected.

Instead, nothing happens.  What is wrong with my script?

Thanks,

--Kenoli
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Test Radio Select</title>
  5. </head>
  6. <body>

  7. <div id="select">
  8. <ul>
  9. <li><input type="radio" name="select" value="add_gallery" > Add a new gallery<br/></li>
  10. <li><input type="radio" name="select" value="change_name_gallery" > Change the name of a gallery<br/></li>
  11. <li><input type="radio" name="select" value="delete_gallery"  > Delete a gallery<br/></li>
  12. </ul>
  13. </div>

  14. <p><div id="message" ></div></p>

  15. <script src="http://code.jquery.com/jquery-latest.min.js"></script>

  16. <script>

  17. $(document).ready(function() {
  18. // Initial content
  19. $(#message).html("Select something.");
  20. // New message when button checked
  21. if ($('#select ul li input:radio:checked')) {
  22. var value = $(this).attr('value');
  23. $(#message).html(value + " button checked.");
  24. };

  25. )};

  26. </script>


  27. </body>
  28. </html>