jquery如何實現 $ 選擇一個文本框,定位焦點?
ajax入門學習視頻
2018-05-09 18:22:20
TA貢獻1條經驗 獲得超0個贊
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="../js/jquery-2.1.4.js" ></script>
</head>
<body>
<input type="text" id="a"/>
<script type="text/javascript">
????$(function(){
????????$("#a").focus(function(){
????????????$(this).css("background-color","bisque")
???????? })
????});
</script>
</body>
</html>
TA貢獻2條經驗 獲得超0個贊
<html> <head> <script?type="text/javascript"?src="jquery.js"></script> <script?type="text/javascript"> $(function(){ $("#a").onfocus(){ alert("獲得焦點"); } }); </script> </head> <body> <input?type="text"?id="a"/> </body> </html>
舉報