<!DOCTYPE html> <html> <body> <p>Enter subject name below,</p> Subject: <input type = "text" id = "sname" onfocus = "display(this.id)"> <br> <script> function display(val) { document.getElementById(val).style.background = "blue"; } </script> </body> </html>
以上就是当HTML元素获得焦点时执行脚本?的详细内容,更多请关注php中文网其它相关文章!
已抢66542个
抢已抢37530个
抢已抢20804个
抢已抢2567个
抢已抢19098个
抢