<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > |
<html> |
<head> |
<title>通过document的getElementById方法来获取文本框对象</title> |
<input type= "text" name= "text1" > |
<script language= "javascript" > |
var textname=document.getElementById( "text1" ); |
textname.value= "that is a Javascript" ; |
textname.select(); |
textname.blur(); |
</script> |
</head> |
<body> |
</body> |
</html> |