我需要修改消息文本(大写),但子元素必须保持不变。 HTML由第三方预先编写。怎么做?
HTML可以是这样的,,我需要修改每条消息的“xy消息文本”。
<div class="message">
<span>
<span class="for you">for you </span> text of the first message.
</span>
</div>
<div class="message">
<span>
text of the <a href="http://www.google.com">http://www.google.com</a> second message :)
</span>
</div>
<div class="message">
<span>
<span class="for you">for you </span> text of the
<img src="http://www.gnutellaforums.com/images/smilies/smile.gif"> third message...
</span>
</div>
应该是这样的:
...
<div class="message">
<span>
TEXT OF THE <a href="http://www.google.com">http://www.google.com</a> SECOND MESSAGE :)
</span>
</div>
...