• JS 禁止粘贴的文本框


    <body>
    <script type="text/javascript">
    //not IE is required
    function fncKeyStop(evt)
    {
        if(!window.event)
        {
            var keycode = evt.keyCode;
            var key = String.fromCharCode(keycode).toLowerCase();
            if(evt.ctrlKey && key == "v")
            {
              evt.preventDefault();
              evt.stopPropagation();
            }
        }
    }
    </script>
    <input onkeydown="fncKeyStop(event)" onpaste="return false" oncontextmenu = "return false;" />
    </body>
  • 相关阅读:
    ES6
    django创建超级用户
    小程序-网络请求api
    小程序-数据双向绑定
    POJ2406 Power Strings
    POJ2758 Checking the Text
    LightOJ1197
    51Nod
    CF55D
    Kattis
  • 原文地址:https://www.cnblogs.com/wantingqiang/p/1703765.html
Copyright © 2020-2023  润新知