How to get the content of a tag inside a label
How can get the content of the b tag?
<label for="onde">
<b>qua qua text</b>
<textarea name="onde"></textarea>
&开发者_如何学编程lt;/label>
I am trying this with no success:
$('textarea[name=onde]').prev().val();
$('label[for="onde"] b').text();
should do it
You were close:
$( 'textarea[name="onde"]' ).prev().text()
Live demo: http://jsfiddle.net/5Y3Q8/
精彩评论