首页 > 代码库 > js 清空input输入数据
js 清空input输入数据
<html>
<head>
<title></title>
</head>
<body>
<span class="searchTpyeText">按手机号查询</span>
<form>
<div class="phoneContent">按手机号查询</div>
<label>
<input id="telData" class="search" type="text" value="http://www.mamicode.com/输入手机号" onfocus="if(this.value =http://www.mamicode.com/= ‘输入手机号‘)this.value = ‘‘;" onblur="if(this.value =http://www.mamicode.com/= ‘‘ || this.value == null)this.value = ‘输入手机号‘;" />
<input id="telFind" class="button" type="button" value="http://www.mamicode.com/搜索"></input>
</label>
</form>
var telData="";
$(‘#telFind‘).click(function(){
telData = http://www.mamicode.com/$(‘#telData‘).val();/
$.ajax({
url:"${pageContext.request.contextPath }/record"+‘/1/10?tel=‘+telData,
type:"get",
contentType:"application/json;charset=utf-8",
dataType:"json",
success:function(data){
$(‘#telData‘).val(‘‘);
}
});
});
</body>
</html>
js 清空input输入数据