想要实现点击输入框消失,只需要给文本输入框加一点js效果即可,可以参考以下代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>txt</title>
<script type="text/javascript">
window.onload=function(){
var oIpt = document.getElementsByTagName('input')
oIpt[0].onclick=function(){
this.value = ""
}
}
</script>
</head>
<body>
<input type="text" value="点我消失!" name="">
</body>
</html>
以上代码实现的效果为,点击文本输入框之后设置input的value值为空。