然后替换嵌套的Elemetn的IMG SRC,而无需ID
我有一个HTML结构,我们无法在生成时更改。
我需要寻找一个特定的IMG SRC,我需要原始的SRC作为Val,然后用我们自己的自定义替换SRC。
结构看起来像这样:
<span id="edit5_WMFStream">
<div>
<img src="...">
</div>
</span>
我想寻找以WMFStream结尾的跨度ID,我没有什么可以ID嵌套的DIV,然后是IMG。已经尝试了几件事,但是到目前为止,甚至无法选择DIV,Letalone img然后是SRC。
I have a HTML structure that we cannot change as it is generated.
I need to look for a specific img src, I need the original src as a val, and also then replace the src with our own custom one.
The structure looks like this:
<span id="edit5_WMFStream">
<div>
<img src="...">
</div>
</span>
I want to look for the span id ending with WMFStream, and I have nothing to id the nested div and then img. Have tried several things but so far can't even get to select the div, letalone the img then src.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以使用QuerySelector来参考图像
maybe you can use querySelector to ref the image