我有几个链接其文本内容我想用基于文本内容的自动生成的图像替换。在jQuery的html(val)语句中访问当前选定元素的内容?
所以目前看起来是这样的:
<a href="blabla" class="mLink">
<span class="mText">The Text in Question</span>
</a>
,我想有两种
<a href="blabla" class="mLink">
<img src="/ImageTextHandler.ashx?message=The+Text+in+Question" alt="The Text in Question"/>
</a>
或
<a href="blabla" class="mLink">
<span class="mText">
<img src="/ImageTextHandler.ashx?message=The+Text+in+Question" alt="The Text in Question"/>
</span>
</a>
如何访问元素在问题里面.replaceWith或.html,以便我可以获取文本内容?
不错转换链接的格式。但是,这将工作几个环节?他们不都会结束吗? – peirix 2009-07-10 08:35:47
如果您对每个匹配元素执行操作,则请不要执行此操作:) – 2009-07-10 08:48:14