I am working with 6 different styles in CSS and I am trying to apply them randomly using the following code:
<script>
function getRandom(max) {
return "style" + Math.floor(Math.random() * max);
}
document.getElementById('YYY').innerHTML = getRandom(6);
</script>
Additionally, I need to add YYY to the article class.
<article class="YYY">
Unfortunately, this code is not functioning as expected.