KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I check in JavaScript if a DOM element contains a class? I tried the following code, but for some reason it doesn't work... if (document.getElementById('element').class == "class_one") { //code... }
Tags (comma-separated)
Save Edits
Cancel