KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Say I have this html element <div id="hello" class="hello option john">Hello</div> <div id="hello" class="hello john">Hello</div> . Now I select the element with javascript by it's Id. How would I do an equivalent of if($('hello').hasClass('option')){//do stuff} (jQuery) except in plain Javascript?
Tags (comma-separated)
Save Edits
Cancel