How can I make this conditional branch.. If the with the ID products is in the HTML code? If #products does exist in the actual document?
Thank you for your response!
Pseudo Javascript (JQuery)
If ( $('#products').existOn.(document) ) == true {
//do this
}
If you want to vary the
documentpart, you’d do something like this:If it’ll always be
document, it’ll suffice to doAn alternative approach of achieving the first example would be to pass a context parameter as a second argument:
Note that the context parameter should be a DOM node, not a jQuery object.