<html>
<head>
<meta charset="utf-8"/>
<script type="text/javascript" src="script/jquery-1.4.2.min.js"></script>
<script>
$(function(){
//在jquery中如果操作的是同一个对象,规范建议换行
$("#username").focus(function)(){
$(this).val("")
.blur(function(){
$(this).val("请输入用户名");
});
});
</script>
</head>
<body>
<input type="text" />
</body>
</html>

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2021-07-05
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案