• 【JS】限制输入内容带特殊符号


    限制文本输入时带一些特殊符号

     1. 首先是实时获取Html中 输入的值

    1. html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8">
    5. <title>title>
    6. head>
    7. <body>
    8. <input id="test" oninput="app()" />
    9. <script>
    10. function app() {
    11. const test =document.getElementById('test');
    12. console.log(test.value)
    13. }
    14. script>
    15. body>
    16. html>

    oninput  事件是在输入框中输入时就会触发,该事件在