第一个js事件
7202019-04-12 16:26:01217 <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
input , button{width: 200px; height: 40px; margin: 5px 0px; line-height: 40px; padding: 0px 5px;box-sizing: border-box;}
input{ border: 1px solid #ddd;}
button{ border: 1px solid #ffa200; background: #ffa200; color: #fff; text-align: center; }
</style>
</head>
<body>
<input type="text" value="张三" readonly="readonly" style="background: #ddd;" onclick="tk(this)" ><br>
<input type="text" placeholder="请输入联系电话" onfocus="dj(this)" onblur="djBg(this)"><br>
<button onmouseover="hg(this)" onmouseout="hc(this)">确认</button>
<script type="text/javascript">
function tk(tk){
alert("姓名不可以修改")
}
function dj(dj){
dj.style.background="#eee"
}
function djBg(djBg){
djBg.style.background="#fff"
}
function hg(hg){
hg.style.color="#ff6200"
}
function hc(hc){
hc.style.color="#fff"
}
</script>
</body>
</html>