This may seem a little odd, but I need to randomize the order of 4 flexbox items. These need to be randomized onInit.
I could randomize the numbers in javascript, but how do I bind that property to CSS?
This is my code:
CSS:
.buttons {
display: flex;
flex-flow: row wrap;
justify-content: space-around;
margin: 2rem;
}
HTML:
<div class="buttons">
<button>{{ mcqs.answer1 }}</button>
<button>{{ mcqs.answer2 }}</button>
<button>{{ mcqs.answer3 }}</button>
<button>{{ mcqs.answer4 }}</button>
</div>
Basically I just need a really simple way to randomize the order of the answers (for a multiple choice test application). Thanks!