由于我是javascript的noobs,我需要一些帮助来弄清楚如何使用纯javascript来获取html代码的特定部分。使用Javascript获取部分HTML代码
我想演这个角色:
6LfLgwgTAAAAAFgpAIOgNmfzKi5Ko2ZnNeIE2uLR
从HTML代码如下:
<div id="document-container">
<div style="width: 304px; height: 78px;">
<div>
<iframe src="https://www.example.com/document/api2/anchor?k=6LfLgwgTAAAAAFgpAIOgNmfzKi5Ko2ZnNeIE2uLR&co=aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbTo0NDM.&hl=en&v=r20170816175713&size=normal&cb=xksmil4x110" title="document widget" scrolling="no" sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups allow-popups-to-escape-sandbox" width="304" height="78" frameborder="0">
</iframe>
</div>
<textarea id="g-document-response" name="g-document-response" class="g-document-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; display: none; ">
</textarea>
</div>
</div>
我确实相信可以使用document.getElementById或regex。我想我可以使用PHP来做到这一点,但我不知道如何在JavaScript中做到这一点。
获取''