去爲某些站點如何檢查是否鏈接使用JavaScript去爲某些站點如何檢查是否鏈接使用JavaScript
function checkLinks() {
var anchors = document.getElementsByTagName('a');
for (var i=0; i<anchors.length; i++){
var anchor = anchors[i];
if (anchor.href == "http://google.com"){/*compare not working*/
alert("exist");
}
}
}
'document.links'應該在這裏協助:https://developer.mozilla.org/en/DOM/document.links – 2011-06-19 19:18:04