EDIT: sorry i’ve rephrased my question
New to JQuery and need some assistance
I would like to iterate all li elements
and to delete the inner span element in one of the li’s.
I do not know where the span is because the li is built dynamically and i cannot count on the id selector
<ol id="selectable" class="ui-selectable">
<li id="1_1_1" class="ui-widget-content ui-selectee">1.1.1</li>
<li id="1_1_2" class="ui-widget-content ui-selectee">1.1.2</li>
<li id="1_1_3" class="ui-widget-content ui-selectee ui-selected">1.1.3<span class="ui-icon ui-icon-check"
style="float: right; margin: 2px 7px 0 0;"></span></li>
<li id="1_1_4" class="ui-widget-content ui-selectee">1.1.4</li>
<li id="1_1_5" class="ui-widget-content ui-selectee">1.1.5</li>
</ol>
How can this be done?
Edit: to delete the span, just do this:
Be aware that it will remove all
span‘s within anylibut from your example, there is only one.Try out toggleClass, addClass and removeClass
These are just a few ways to change the class of all
li‘s that match the selector.