use*_*629 5 html javascript jquery
我希望能够访问以下 html 结构
<div id="collection_propID214_formID1">
<p class="fieldHeaderContainer">
<strong>Add by ID:</strong>
</p>
</div>
Run Code Online (Sandbox Code Playgroud)
并使用 jQuery 更改标签内的文本。这可能吗?
您可以更改using中的strong标签文本。div.text()
尝试这个:
$('#collection_propID214_formID1 strong').text('Your text here');
Run Code Online (Sandbox Code Playgroud)
或者
$('#collection_propID214_formID1').find('strong').text('Your text here');
Run Code Online (Sandbox Code Playgroud)
PS:如果有多个强元素,这将更改所有文本。
| 归档时间: |
|
| 查看次数: |
5732 次 |
| 最近记录: |