As shown below:
<pre name= "code" class= "HTML" ><input type= "text" onpaste= "if (isnum (' text ')" = =false) return false; "class=" Input-txt-small "id=" Productprice "onblur=" Checkprice (' productprice ', ' Pricedw ') "
Onkeyup= ' if (isNaN (value)) ExecCommand (' Undo ') ' onafterpaste= ' if (isNaN (value) execcommand (' Undo ') "/> Meta </pre ><br>
function Isnum (num) {var renum=/^\d*$/; if (renum.test (num)) {return true;} else {if (num < 0) {AL ERT ("The price cannot be negative!") "); } else {alert ("Price must be a number!") "); } return false; }}
<pre></pre>
<p><br>
</p>
<p></p><pre name= "code "class=" javascript ><pre name= "code" class= "HTML" >window.clipboarddata.getdata (' text ') </pre><p ></p>
<pre></pre>
for getting pasted content <br>
<p></p>
The above is small series for everyone to bring the JS judge Price, must be a number and can not be negative for the realization of the full content of the method, I hope that many support cloud Habitat Community ~