Stef,

On May 22, 2007, at 10:40 AM, stef wrote:

when a radio button is clicked, show its
value. i have the code below, which i dont think is the best way to go
about it. it always alerts "undefined". my reasoning is: when the
document has loaded, and an input element in the div with id 'test' is
focussed, show an alert of the value of the currently checked radio
button.

 $(function(){
        $("#test/input").focus( function() {
        alert($("[EMAIL PROTECTED]@checked]").value);});

 });

Having a url to a live page to debug would make it easier for us to help you. A guess would be something like this...

$(function() {
  $("#test/[EMAIL PROTECTED]'radio']").bind("focus", function() {
    if ( this.checked ) alert(this.value);
  });
});

--
Roger Roelofs



Reply via email to