[JavaScript] 当文本框内容改变时执行指定的JS代码将文本框字符转换成大写 →→→→→进入此内容的聊天室

来自 , 2021-04-25, 写在 JavaScript, 查看 182 次.
URL http://www.code666.cn/view/c03afab5
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function myFunction()
  6. {
  7. var x=document.getElementById("fname");
  8. x.value=x.value.toUpperCase();
  9. }
  10. </script>
  11. </head>
  12. <body>
  13.  
  14. Enter your name: <input type="text" id="fname" onchange="myFunction()">
  15. <p>When you leave the input field, a function is triggered which transforms the input text to upper case.</p>
  16.  
  17. </body>
  18. </html>
  19.  
  20. //javascript/7957

回复 "当文本框内容改变时执行指定的JS代码将文本框字符转换成大写"

这儿你可以回复上面这条便签

captcha