我有以下html。
<dl class="item-options">
<dd class="truncated" style="color:red;">DSOX3000-232, RS232/UART Serial Decode and Trigger - in <a onclick="return false" class="dots" href="#">...</a>/<div class="truncated_full_value"><dl class="item-options"><dt>Software Applications</dt><dd id="pppp">DSOX3000-232, RS232/UART Serial Decode and Trigger - installed, DSOX3000-AMS, CAN and LIN Automotive Serial Decode - installed, DSOX3000-MAT, Advanced Math Analysis for Infiniivision Oscilloscopes - installed, DSOX3000-VID, Enhanced Video/TV Application Package - installed/</dd></dl></div>
</dd>
<div class="mdata">
<dd class="truncated">DSOX3000-001, WaveGen 20 MHz Function/Arbitrary Wavefor <a onclick="return false" class="dots" href="#">...</a>/<div class="truncated_full_value"><dl class="item-options"><dt>Advanced Analysis</dt><dd id="pppp">DSOX3000-001, WaveGen 20 MHz Function/Arbitrary Waveform Generator - installed/</dd></dl></div></dd>
</div>
<p id="warranty" style="margin-top:10px"></p>
<dd>R-51B-001-5F, Return to Agilent Warranty - 5 years</dd><p>
</p>
</dl>
我<dl class="item-options">
假设所有内容都在一个变量中 var mycontent
。
如何<p id="warranty" style="margin-top:10px"></p><dd>R-51B-001-5F, Return to Agilent Warranty - 5 years</dd><p></p>
从该变量中删除此内容mycontent
。
mycontent
是一个将传递给弹出窗口的变量。所以我想保留
<p id="warranty" style="margin-top:10px"></p><dd>R-51B-001-5F, Return to Agilent Warranty - 5 years</dd><p></p>
在 html 文档中,但仅从变量中删除。
谢谢