is there a way to disable 'tab' on a input type='text'?

前端 未结 3 793
南旧
南旧 2021-02-20 12:38

is there a cross-browser solution to disable \'tab\' on a input type=\'text\' ?


Pressing \'tab\' moves you to the

3条回答
  •  星月不相逢
    2021-02-20 12:56

    a non jQuery implementation would be a bit like this -

    HTML would be

    
    

    and JS something like below

    function stopTab( e ) {
        var evt = e || window.event
        if ( evt.keyCode === 9 ) {
            return false
        }
    }
    

提交回复
热议问题