ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Life >

[JS]User name keyword check

Thursday on January 1st, 1970Life

keyword check for user name registration.

 & lt;script type="text/javascript">Function check () {Var content = document.getElementById (& quot;user") .valueIf (checkDenyWords (content) = & quot;") {Document.getElementById (& quot;txt"). InnerHTML = & quot; this user name is approved by. & quot} else {Document.getElementById (& quot;txt") .innerHTML = & quot; your user name cannot contain: & quot;+checkDenyWords (content)}}Function checkDenyWords (content) {If (content = = null | | content = = & quot;") return & quot;"Var wordsArrays = new Array ()WordsArrays = new Array (& quot; Integrity Business Network & quot;," Integrity Business & quot;," Registration & quot;," website & quot;," website & quot;," Enterprise Network & quot;,"Chener","chener")For (var kryptonite kryptonite wordsArrays.wordsArray.If (content.indexOf (wordsArrays [k])! =-1) {Return wordsArrays [k]}}Return & quot;"}& lt;/script>& lt;input type="text" id="user" value=""/& gt; 

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/life/JS-User-name-keyword-check.htm