I have a sortable where it was created with loaded from JSON files. Now I want to delete an item.
I receive from a textarea the element name that I have to cancel.
I save in a variable namdel
.
With a for loop I am going to compare this variable with the name of the sortable.
The HTML code of the sortable:
<div id="sortparam">
<ul style="" class="ui-sortable" id="sortable">
<li style="" id="1" class="ui-state-default"> <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Singular sensation</li>
<li style="" id="2" class="ui-state-default"> <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Beady little eyes</li>
<li style="" id="3" class="ui-state-default"> <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Little birds </li>
</ul>
</div>
The problem is how to read the items because if I read with:
var contapara=1;
var l = document.getElementById(contapara).innerHTML;
alert(l);
The program write in alert window:
<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Little birds
I want only Little birds
.
<li>
elements meaningful names ordata-
attributes when parsing the JSON file instead of mucking with the rendered HTML?