May 26 2014

javascript文本框内的提示

 

 

 

 

 

<html:textarea name=”contentDescribe” property=”contentDescribe” style=”width: 680px;height:50px;”

onfocus=”focusObj(this, ‘请输入内容描述’);” onblur=”blurObj(this, event, ‘请输入内容描述’);”/>

 

 

 

 

function focusObj(obj, tishi) {

if (obj.value == tishi) {

obj.style.color = “#000000″;

obj.value = ”;

}

return false;

}

 

function blurObj(obj, evt, tishi) {

if (obj.value == ”) {

obj.value = tishi;

obj.style.color = “#999999”;

}

return false;

}



Copyright 2019. All rights reserved.

Posted 2014年5月26日 by ucjmh in category "javascript

Leave a Reply

Your email address will not be published. Required fields are marked *