Commonly used javaScript code
commonly used javaScript codes
judgment characters are all composed of characters of Amurz or Amurz:
& lt;input onblur="if (/[^ a-zA-Z]/g.test (this.value)) alert ('wrong') & quot;>
judgment character consists of letters and numbers:
& lt;input onblur="if (/[^ 0-9a-zA-Z]/g.test (this.value)) alert ('wrong') & quot;>
judgment characters consist of letters and numbers, underscores, and periods. And can only begin with an underscore and a letter:
/^ ([a Meiz Amurz] {1}) ([\ w] *) $/g.test (str)
determine the type of browser:
window.navigator.appName
determine the version of ie:
window.navigator.appVersion
judge the resolution of the client:
window.screen.height; window.screen.width
check boxes: all, multiple, none, reverse:
& lt;form name=hrong>& lt;input type=checkbox name=All onclick="checkAll ('mm') & quot;> Select all & lt;br/>& lt;input type=checkbox name=mm onclick="checkItem ('All') & quot;>
")Document.write (cidInfo & quot;340524198002300019"), & quot;
")Document.write (cidInfo & quot;510215198108241648"), & quot;
")Document.write (cidInfo & quot;34052419800101001x"), & quot;
")& lt;/script>
Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/life/Commonly-used-javaScript-code.htm