jQuery child of clicked element
- by Tom
Hi,
I've got a list of links which have a click event attached to them, I need to get the ID from the child A link. So in the example below if I clicked the first list element I'd need google retuned.
I've tried '$this a' but can't quite work out the syntax.
jQuery:
$("ul li").click(function(event){
$("input").val($(this).html());
}
);
html:
<ul>
<li><a href="http://www.google.com" id="google">Google</a>
</ul>