I want to remove a span tag from a html output.
Say like i have a variable template which holds a html output.
<li id="GRP_1" data-role="list-divider">Group 1<span id="121" onclick="deleteGroup(this.id);" class="ui-icon ui-icon-delete ui-icon-shadow li-divider-icon-right"> </span></li>
In the above html output i want to remove/hide the span tag. If possible give me a solution for both hide & remove that span tag. Find the fiddle example here
You could do it in many different ways.
By id:
$('#121').hide();or$('#121').remove();By html element:
$('span').hide();or$('span').remove();And by class:
$('ui-icon.ui-icon-delete.ui-icon-shadow.li-divider-icon-right').hide();or
$('ui-icon.ui-icon-delete.ui-icon-shadow.li-divider-icon-right').remove();