标签:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题pj文档</title>
<script>
window.onload = function() {
var obtn=document.getElementById(‘btn‘);
var otext=document.getElementById(‘text1‘);
otext.onfocus=function()
{
if(this.value==‘please‘)
{
this.value=‘‘;
}
}
otext.onblur=function()
{
if(this.value==‘‘)
{
this.value=‘please‘;
}
}
obtn.onclick=function()
{
otext.select();
}
//obj.focus()
//obj.blur();
//obj.select()
}
</script>
</head>
<body>
<input type="text" id="text1" value="please" />
<input type="button" value="全选" id="btn" />
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/hduhdc/p/5418712.html