Acara pengumpulan kursor tutorial asas Javascript
onfocus Cursor gathering event
Mari kita tulis contoh cursor gathering event
Kodnya adalah seperti berikut:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>光标聚集事件</title> </head> <body> <form> 来自:<select name="op" onfocus="onf()"> <option>安徽</option> <option>池州</option> <option>安庆</option> <option>六安</option> <option>阜阳</option> </select> </form> <script type="text/javascript"> function onf(){ alert('请选择,您来自哪里'); } </script> </body> </html>