input el-input verification can only enter a positive integer

Js numbers belonging to the letter e, the matching is generally regular \ d is able to prevent the letter e

Correct wording is:

onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"

 

Guess you like

Origin www.cnblogs.com/fmixue/p/10957038.html