if (((document.activeElement).parentNode).tagName == "div") {
//do amazing things
}
For some reason a specific function of mine isn’t working, and I think it has to do with the line above. Is the line above syntactically correct, or is wrong? If the line above is correct, I’ll either delete the question (because then the question is useless) or add additional information of the rest of the function.
Thanks
The tagName gives the tag in upper-case so it would give
DIVSee https://developer.mozilla.org/en-US/docs/DOM/element.tagName
You can use
.toLowerCase() == 'div'(as suggested in the comments) to eliminate the case issue.