//检查qq格式是否正确 function check_qq(thisObj) { var qq = document.getElementById('qq').value; var reg = /^\d+$/; if (qq.search(reg)) { document.getElementById('show_qq').innerHTML = " QQ 只能为数字"; return false; } else { document.getElementById('show_qq').innerHTML = ""; return true; } }