獲得聚焦之后的如何選擇?
<title>?光標聚焦事件?</title> ??<script?type="text/javascript"> ????function?message(){ ??????alert("請選擇,您現在的職業!"); ????} ??</script> </head> <body> 請選擇您的職業:<br> ??<form> ????<select?name="career"onfocus="message()">? ??????<option>學生</option>? ??????<option>教師</option>? ??????<option>工程師</option>? ??????<option>演員</option>? ??????<option>會計</option>? ????</select>? ??</form> </body> </html>
這段代碼可以獲得聚焦事件,但是如果我要進行選擇,就會彈出提示框,我要怎么在提示框彈出之后可以進行選擇?
2016-09-30
為什么要有兩個“onfocus”呢?
2016-09-30
<title>?光標聚焦事件?</title>
??<script?type="text/javascript">
????function?message(){
??????alert("請選擇,您現在的職業!");
????}
??</script>
</head>
<body>
請選擇您的職業:<br>
??<form>
????<select?name="career"onfocus="message()" onfocus="message()">?
??????<option>學生</option>?
??????<option>教師</option>?
??????<option>工程師</option>?
??????<option>演員</option>?
??????<option>會計</option>?
????</select>?
??</form>
</body>
</html>