国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

用javascript實現分割提取頁面所需內容

2019-11-21 02:05:49
字體:
來源:轉載
供稿:網友
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>文檔</title>
<style>
textarea {
    width:100%;
    height:200px;
}
</style>
</head>

<body>
<textarea id="xxx">
<P><KBD class=showflash title=http://localhost/elearning/storeagemultimirror/multiMirror.swf> 正文正文<a href="javascript:;" onClick="javascript:tagshow(event, '%D0%E9%C4%E2%BB%AF');" target="_self"><u><strong>標簽</strong></u>< /a>正文正文正文正文正文正文。</KBD><BR></P>
</textarea>

<input type="button" value="獲取內容" onclick="getcontent();" />
<textarea id="aaa"></textarea>
<textarea id="bbb"></textarea>
<script>
function getcontent(){
    var str=document.getElementById("xxx").value;
    document.getElementById("aaa").value=str.match(/<KBD.+?title=["']?(.+?)[ '">]/i)[1];
    document.getElementById("bbb").value=str.match(/<KBD.+?>((?:.|/n)+?)<//KBD>/i)[1];
}
</script>
</body>
</html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 山丹县| 徐闻县| 阳东县| 阿拉善右旗| 崇礼县| 寻乌县| 长武县| 高淳县| 绥江县| 兴义市| 宜丰县| 盱眙县| 南郑县| 丁青县| 哈巴河县| 奎屯市| 上林县| 镇赉县| 永胜县| 万荣县| 丹巴县| 白城市| 崇阳县| 潼关县| 独山县| 绥芬河市| 莒南县| 美姑县| 手游| 腾冲县| 安陆市| 永兴县| 博爱县| 泰安市| 南宁市| 遂昌县| 美姑县| 永宁县| 通榆县| 石林| 东山县|