I'm looking for a small javascript code which will check for a div class and if it's not there then it will redirect the page to a site which is specified in javascript code.
I have this code, but I want it in document.getElementById
form because I'm learning and I tried making the code. The below code is jQuery which I found here on this site.
function check() {
if ($('#demodivclass').length === 0) {
redirect(somesite.com);
}
Can anyone help?