crop_rotate
Run
<!DOCTYPE html> <html> <head> <style> .mystyle { width: 500px; height: 50px; } .anotherClass { background-color: lightblue; } .thirdClass { text-align: center; font-size: 25px; color: black; margin-bottom: 10px; } </style> </head> <body> <p>Click the button to display the number of class names the div element has.</p> <div id="myDIV" class="mystyle anotherClass thirdClass"> I am a DIV element with three classes </div> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> The classList property is not supported in Internet Explorer 9 and earlier versions.</p> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myDIV").classList.length; document.getElementById("demo").innerHTML = x; } </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxoZWFkPg0KPHN0eWxlPg0KLm15c3R5bGUgew0KICB3aWR0aDogNTAwcHg7DQogIGhlaWdodDogNTBweDsNCn0NCg0KLmFub3RoZXJDbGFzcyB7DQogIGJhY2tncm91bmQtY29sb3I6IGxpZ2h0Ymx1ZTsNCn0NCg0KLnRoaXJkQ2xhc3Mgew0KICB0ZXh0LWFsaWduOiBjZW50ZXI7DQogIGZvbnQtc2l6ZTogMjVweDsNCiAgY29sb3I6IGJsYWNrOw0KICBtYXJnaW4tYm90dG9tOiAxMHB4Ow0KfQ0KPC9zdHlsZT4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+IDo6LXdlYmtpdC1zY3JvbGxiYXJ7d2lkdGg6N3B4O2hlaWdodDo3cHg7fTo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2t7YmFja2dyb3VuZDojZmZmO306Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1ie2JvcmRlci1yYWRpdXM6NXB4O2JhY2tncm91bmQ6IzJmNDVmZjt9PC9zdHlsZT48L2hlYWQ+DQo8Ym9keT4NCg0KPHA+Q2xpY2sgdGhlIGJ1dHRvbiB0byBkaXNwbGF5IHRoZSBudW1iZXIgb2YgY2xhc3MgbmFtZXMgdGhlIGRpdiBlbGVtZW50IGhhcy48L3A+DQoNCjxkaXYgaWQ9Im15R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