我有一个像这样的 DOM
<table style="display:none;" id="risposta-campione">
<tr>
<td>
<label>Risposta</label><textarea id="risposta_0000" name="risposta_0000" cols="35" rows="2"></textarea>
<button type="button" onclick="cancellaRispostaDomanda('0000')" class="cancella-risposta"></button>
<button type="button" onclick="aggiungiRispostaDomanda('0000')" class="aggiungi-risposta"></button>
</td>
</tr>
</table>
我想用 jquery 替换所有出现的“0000”,而不获取每个元素。
这可能吗?
我试过这个:
elem = $('#risposta-campione').text() // how convert dom to string?!
elem.replace('0000', 'hello');
没有解决方案:-/
Use $('#risposta-campione').html().replace('0000', 'hello');
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)