たまに登録フォームとかで見る、フォーカスを外すとエラーが出るjavascriptを作ってみた。 ちょっと長いけど、ソースをべろっと。 const filterValues = /[&\\<>\"\']/; //"禁則文字 //コンストラクタ var chkInput = function(param){ for(i in param){ this[i] = param[i]; } if(typeof param.id == 'object'){ this.parentNode = document.getElementById(param.id[0]).parentNode; //親ノード for(i in param.id){ this.id[i] = document.getElementById(param.id[i]); this.id[i].superc = this; this