Posted in Javascript onMay 07, 2009
function styleHeaderSiblings(){
if(!document.getElementByTagName)return false;
var headers = document.getElementByTagName("h1");
for(var i = 0;i<headers.length;i++){
addClass(elem,"intro");
}
}
function styleElementSiblings(tag,thechass){
if(!document.getElementByTagName)return false;
var elems = document.getElementsByTagName(tag);
for(var i = 0 ;i<elems.length;i++){
var elem = getNextElement(elem[i].nextSibling);
addClass(elem,theclass);
}
}
function addClass(elemnt,value){
if(!element.className){
element.className = value;
}else{
newClassName = element.className;
newClassName +="";
newClassName +=value;
element.className = newClassName;
}
}
javascript 有用的脚本函数
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@