196
rated 0 times
[
198]
[
2]
/ answers: 1 / hits: 58234
/ 13 Years ago, fri, may 27, 2011, 12:00:00
Just a quick example:
<p>
<span class=example></span>
<input type=text name=e_name id=e_id />
</p>
<script type=text/javascript>
$('input').click(function(){
$(this).parent().children('span').text('Suprise!');
}
</script>
What can I use instead parent().children()?
I think it's a bit inelegant piece of code.
Is any function i.e : $(this).fun('span').text('just better'); ??
More From » jquery