I'd like to be able to reach out into the following html structure
<div id="collection_propID214_formID1">
<p class="fieldHeaderContainer">
<strong>Add by ID:</strong>
</p>
</div>
And change the text inside of tag, using jQuery. Is this possible?
I'd like to be able to reach out into the following html structure
<div id="collection_propID214_formID1">
<p class="fieldHeaderContainer">
<strong>Add by ID:</strong>
</p>
</div>
And change the text inside of tag, using jQuery. Is this possible?
Share Improve this question edited Aug 28, 2014 at 19:03 imbondbaby 6,4113 gold badges22 silver badges54 bronze badges asked Aug 26, 2014 at 18:25 user2917629user2917629 9424 gold badges17 silver badges34 bronze badges 1-
$('#collection_propID214_formID1 strong').text('Hello Wolrd!');
? – Karl-André Gagnon Commented Aug 26, 2014 at 18:27
1 Answer
Reset to default 6You could change the text of the strong
tags inside the div
using .text()
.
Try this:
$('#collection_propID214_formID1 strong').text('Your text here');
JSFiddle Demo
Or
$('#collection_propID214_formID1').find('strong').text('Your text here');
P.S: If there are more than one strong elements, this would change the text for all.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744312111a4567999.html
评论列表(0条)