var ab = document.getElementById('cutec'); if (ab.innerHTML.search(//i) != -1) { document.getElementById('cutec').innerHTML = ''; }else{ document.getElementById('cutec').innerHTML = 'Your Web Code Error'; }