JSFiddle - React, Tailwind, and code Playground
by dkunin
HTML
<p class='tsa'>w5e</p>
<ul>
<li>1</li>
<li>2</li>
</ul>
JavaScript
$(document).ready(function(){
$.fn.randomize = function(childElem) {
return this.each(function() {
var $this = $(this);
var elems = $this.children(childElem);
elems.sort(function() { return (Math.round(Math.random())-0.5); });
$this.empty();
for(var i=0; i < elems.length; i++)
$this.append(elems[i]);
});
}
$.each($('.tsa'),function(value,index){
$(this).empty();
$("<select></select>")
.append( $('<option></option>').val(0).html(''))
.append( $('<option></option>').val(0).html('тся'))
.append( $('<option></option>').val(0).html('ться'))
.appendTo($(this))
.css('font-size','22px').addClass('check')
})
$('select').randomize('option');
});