gpt4 book ai didi

javascript - 使用javascript提取字符串

转载 作者:行者123 更新时间:2023-12-01 02:25:32 25 4
gpt4 key购买 nike

我正在使用 jquery 并将整个 html 页面存储在 var page

var page = '<html>...<div id="start">......</div><!-- start -->....</html>';

如何仅提取以 <div id="start"> 开头的部分一直到结束标记 </div><!-- start --> 之后这样我的输出是

<div id="start">......</div><!-- start -->

最佳答案

$(page).find('#start').html();

关于javascript - 使用javascript提取字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4149471/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com