Currently, I have a group of elements that can be sorted with a text:
How can I easily convert this group into a list of checkboxes with labels with minimal code adjustments?
Original Code:
<div class='left'>
<ul id="sortable">
<li class="ui-state-highlight"></li>
<li class="ui-state-highlight"></li>
<li class="ui-state-highlight"></li>
</ul>
</div>
Script
<script>
$(function() {
$( "#sortable" ).sortable({
items: "li:not(.ui-state-highlight)",
placeholder: "ui-state-highlight"
});
$( "#sortable" ).disableSelection();
});
</script>
Javascript
var nodes = document.getElementById('sortable').getElementsByClassName('ui-state-highlight');
if (nodes.length > 0)
{
nodes[0].innerHTML = getSymbol();
nodes[0].setAttribute("class", "ui-state-default");
}