Adding Class to Div in jQuery -
evening all,
i'm trying add class div have not working reason.
$(.example div).addthisclass('example class'); why isn't working, works every other time? has jquery changed?
pls help.
there no method addthisclass in jquery. use addclass:
$('div.example').addclass('example class'); in vanilla javascript, can use classlist:
document.queryselector('div.example').classlist.add('example class');
Comments
Post a Comment