欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

當(dāng)某個文本框成為焦點(diǎn)時即清除文本框內(nèi)容

 更新時間:2014年04月28日 17:18:05   作者:  
這篇文章主要介紹了當(dāng)某個文本框成為焦點(diǎn)時如何清除文本框內(nèi)容,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>成為焦點(diǎn)時清除文本框內(nèi)容</title>
<script>
window.onload = initAll;

function initAll(){
var clearText = document.getElementsByTagName("input");
for (var i=0; i<clearText.length; i++){
clearText[i].onfocus = function ( ){
this.value = "";
}
}
}
</script>
</head>

<body>
文本框一:<input type="text" name="text" id="clearText1" value="清除文本框一的內(nèi)容"/><br/>
文本框二:<input type="text" name="text" id="clearText2" value="清除文本框二的內(nèi)容"/><br/>
文本框三:<input type="text" name="text" id="clearText3" value="清除文本框三的內(nèi)容"/>
</body>
</html>

相關(guān)文章

最新評論