html
<span class="checkbox" GroupName="ckmill">
<input id="ctl01" type="checkbox" name="ctl01" />
<label for="ctl01">A</label></span>
js
$(document).ready(function() {
$('.checkbox').click(function(){
var $text2=$(this);
alert($text2.attr("text"));
});
});
while executing it shows.. UNDEFINED
What is the solution?
Dmeo: http://jsfiddle.net/LuRqK/
2 things:
1) to get the attribute of the inner input use
childrenhttp://api.jquery.com/children/2) to get the text or html use
.textor.htmlapicodE