tags:

views:

32

answers:

1

Given the following HTML:

    <p id="noteTypebox">
    <label for="noteType_1" class="notetypelabel active" id="noteType_1">
    <input type="radio" name="noteTypeID" value="1" checked="checked" class="notetype">Project Meeting</input>
    </label>
<label for="noteType_2" class="notetypelabel" id="noteType_2">
<input type="radio" name="noteTypeID" value="2" class="notetype">IDI</input>
</label>

    </p>

How can I write JQUERY to bind to the LABEL, so that on click it alerts first the LABEL's ID and then the INPUT's value (1)?

Thanks

+1  A: 

//

$('label').click(function(){
  alert(this.id);
  alert($(this).find('input').val());
});
czarchaic