41 kinds of webpages common tips (script)

xiaoxiao2021-03-05  20

0. Only the number is allowed (code intercept from a shopping cart) Function Reginput (Obj, Reg, InputStr) {var Docsel = document.selection.createRAnge () c (Docsel.Parentelement (). Tagname! = "Input") Return false oSel = docSel.duplicate () oSel.text = "" var srcRange = obj.createTextRange () oSel.setEndPoint ( "StartToStart", srcRange) var str = oSel.text inputStr srcRange.text.substr (oSel.text Return reg.test (str)}

" value = "<% = quativity%>" Type = "text" size = "3" value = "1" onkeypress = "Return Reginput (this, / ^ [0-9] * $ /, string.fromcharcode (event.keycode)) "onpaste =" Return Reginput (this, / ^ [0-9] * $ /, window.clipboardData.GetData ( 'Text')) "οndrοp =" Return Reginput (this, / ^ [0-9] * $ /, event.datatransfer.getdata ('Text') ">

1. οncοntextMenu = "window.event.ReturnValue = false" will thoroughly shield the mouse button

NO can be used for Table2. Cancel Select, prevent copy 3. οnpaste = "return false" is not allowed to paste 4. οncοpy = "Return False;" oncut = "Return False;" Prevent Copy 5. IE address column is replaced with your own icon 6. You can display your icon in your favorites 7. Close input method 8. Always bring the frame