how can i add a new class to div in onclick function

sarathlal s asked on June 12, 2014 03:43

How can i add a new class to div in onclick function

Recent Answers


Joshua Adams answered on June 12, 2014 09:42

This could be an option for adding by using jQuery, this way could only be used if you are loading jQuery library into the page.

jQuery('#mydivid').click(function(){ jQuery(this).addClass("newClass"); });

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.