if(.is-open close-now){
jQuery(".extra_div").click(function($){
alert('"Sorry, this takeaway only accepts orders during its opening hours"');
});
}
I think something like the above is what I need but I don't know how the if statement part should work out.
I'm looking to check if a certain div is present and then if it is, run the following jQuery on click code.
Update 1
if ($(.is-open close-now).length){
jQuery(".extra_div").click(function($){
alert('"Sorry, this takeaway only accepts orders during its opening hours"');
});
}
The two divs are
is-open open-now - open .is-open close-now - closed