txt.onfocus=function(){
this.style.height="50px";
}
txt.onblur=function(){
this.style.height="20px";
}
txt.onkeyup=function(){
total.innerHTML=this.value.length;
}
this.style.height="50px";
}
txt.onblur=function(){
this.style.height="20px";
}
txt.onkeyup=function(){
total.innerHTML=this.value.length;
}
2016-09-13
e = e || window.event;
var el = e.srcElement || e.target;
少了后面的一點(diǎn)點(diǎn)代碼所以在firefox下不能有所操作
var el = e.srcElement || e.target;
少了后面的一點(diǎn)點(diǎn)代碼所以在firefox下不能有所操作
2016-09-01
txt.onfocus=function(){
txt.className='txt';
}
txt.onblur=function(){
txt.className='';
}
//輸入框鍵盤彈起時(shí)計(jì)算字?jǐn)?shù)
txt.onkeyup=function(){
var len =txt.value.length;
total.innerHTML= len;
}
txt.className='txt';
}
txt.onblur=function(){
txt.className='';
}
//輸入框鍵盤彈起時(shí)計(jì)算字?jǐn)?shù)
txt.onkeyup=function(){
var len =txt.value.length;
total.innerHTML= len;
}
2016-08-23
box.onmouseover=function (ev) {
var ev=ev?ev:window.event;
var target=ev.target || ev.srcElement;
if (target.nodeName==="SPAN") {
target.style.color=target.style.color===""?target.style.color="#f50":target.style.color="";
}
};
var ev=ev?ev:window.event;
var target=ev.target || ev.srcElement;
if (target.nodeName==="SPAN") {
target.style.color=target.style.color===""?target.style.color="#f50":target.style.color="";
}
};
2016-08-20
btn.onclick=function () {
var li=document.createElement("li");
if (text.value==null) {
return ;
}
else {
li.innerHTML=text.value;
list.appendChild(li);
}
};
var li=document.createElement("li");
if (text.value==null) {
return ;
}
else {
li.innerHTML=text.value;
list.appendChild(li);
}
};
2016-08-20
我又發(fā)現(xiàn)多一個(gè)parentNode,這個(gè)效果也能實(shí)現(xiàn)。
case 'praise':
praiseBox(el.parentNode.parentNode.parentNode.parentNode, el);
break;
case 'praise':
praiseBox(el.parentNode.parentNode.parentNode.parentNode, el);
break;
2016-08-10