我有一个只包含文本组件的div,一些文本已用背景颜色rgb(255,255,0)高亮显示。如何使用javascript检索html中所有突出显示的单词
我想要做的是在这个div中获取颜色rgb(255,255,0)突出显示的任何内容,并将它们转换为使用javascript的字符串数组。
这里的html代码:
<html><head>
</head>
<body class="body">
<div style="height: 10px;"></div>
2009 BMW for $5,800.00
<br>
Manheim Auto-Assign on run 3
<br><span style="background-color: rgb(255, 255, 0);">
Condition</span> and <span style="background-color: rgb(255, 255, 0);">Documentation</span> issues
<div style="height: 10px;"></div>
Estimated Gross Profit of $15.00
<br>
Estimated Margin Variance of -42%
<br>
<br>
Offer of $5,775.00
<br>
Current Offer Variance of $825.00
</body></html>
现在,从这个网站,我要检索的文本Condition
和Documentation
因为它们是突出的话,并把它们存储阵列英寸 任何人都可以帮助如何在javascipt中做到这一点?
可以帮助我们通过PO帮助你蜇你的代码到目前为止,并解释什么不工作? – elclanrs
你可以提供文字吗? –
可能是他想让我们写一个JS代码 – HackerKarma