javascript正則獲取a標簽的href
js正則獲取a標簽的href ...
Regex regex new Regex lt a gt href s : lt href gt lt href gt lt href gt gt s s gt gt lt text gt . lt a gt , RegexOptions.IgnoreCase for Match match regex .Match html match .Success match match .NextMa ...
2014-09-03 09:55 0 2210 推薦指數:
js正則獲取a標簽的href ...
獲取單個a中href的值: 獲取多個a中的href的值: ...
獲取單個a中href的值: 獲取多個a中的href的值: ...
...
<script type="text/javascript">function getHref(obj){ alert(obj.href);} </script><a href="http://www.baidu.com" onclick="getHref ...
取href中的id值14 ...
for(i=0;i<=document.getElementsByTagName("a").length;i++){ console.log(document.getElementsByTagName("a")[i].href); //輸出該頁面的所有鏈接。 } 獲取 ...