crop_rotate
Run
<!DOCTYPE html> <html> <head> <title>CloseTag | JavaScript DOM ClassList | add</title> <style> .heading { background-color:#007bff; padding:10px; color:white; } </style> </head> <body> <h1>JavaScript DOM ClassList add</h1> <p id="h1" class="abc xyz">this element contains some classes ["abc","xyz"]<p> <script> let h1 = document.getElementById("h1"); /* classes before add */ console.log(h1.classList); h1.classList.add('heading'); /* classes after add */ console.log(h1.classList); </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxoZWFkPg0KPHRpdGxlPkNsb3NlVGFnIHwgSmF2YVNjcmlwdCBET00gQ2xhc3NMaXN0IHwgYWRkPC90aXRsZT4NCjxzdHlsZT4NCiAgLmhlYWRpbmcNCiAgew0KICBiYWNrZ3JvdW5kLWNvbG9yOiMwMDdiZmY7DQogIHBhZGRpbmc6MTBweDsNCiAgY29sb3I6d2hpdGU7DQogIH0NCjwvc3R5bGU+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiA6Oi13ZWJraXQtc2Nyb2xsYmFye3dpZHRoOjdweDtoZWlnaHQ6N3B4O306Oi13ZWJraXQtc2Nyb2xsYmFyLXRyYWNre2JhY2tncm91bmQ6I2ZmZjt9Ojotd2Via2l0LXNjcm9sbGJhci10aHVtYntib3JkZXItcmFkaXVzOjVweDtiYWNrZ3JvdW5kOiMyZjQ1ZmY7fTwvc3R5bGU+PC9oZWFkPg0KPGJvZHk+DQo8aDE+SmF2YVNjcmlwdCBET00gQ2xhc3NMaXN0IGFkZDwvaDE+DQoNCjxwIGlkPSJoMSIgY2xhc3M9ImFiYyB4eXoiPnRoaXMgZWxlbWVudCBjb250YWlucyBzb21lIGNsYXNzZXMgWyJhYmMiLCJ4eXoiXTxwPg0KDQo8c2NyaXB0Pg0KbGV0IGgxID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImgxIik7DQovKiBjbGFzc2VzIGJlZm9yZSBhZGQgKi8NCmNvbnNvbGUubG9nKGgxLmNsYXNzTGlzdCk7DQpoMS5jbGFzc0xpc3QuYWRkKCdoZWFkaW5nJyk7DQovKiBjbGFzc2VzIGFmdGVyIGFkZCAqLw0KY29uc29sZS5sb2coaDEuY2xhc3NMaXN0KTsNCjwvc2NyaXB0Pg0KDQo8L2JvZHk+DQo8L2h0bWw+