I want to hide a text inside the html tag, the problem inside this html tag the text not wrapped inside any tag, so it makes me wonder how to hide the text. here's my code:
<ul class="nav items">
<li class="nav item ">
<strong>
<i class="ion-speedometer"></i> Dashboard
</strong>
</li>
<li class="nav item"><a href="#"><i class="ion-model-s"> </i>Delivery Order History</a></li>
<li class="nav item vendor-guide ">
<a href="#"><i class="ion-help"> </i>Help Guide</a>
</li>
<li class="nav item" id="collapse-list">
<div class="seperator">
<span class="outer-line"></span>
<span class="fa fa-lg fa-angle-double-left" id="arrow-collapse" aria-hidden="true" style="margin:10px 0"></span>
<span class="fa fa-lg fa-angle-double-right" id="arrow-show" aria-hidden="true" style="margin:10px 0;display:none;"></span>
<span class="outer-line"></span>
</div>
</li>
</ul>
as you can see from above code beneath li html tag there is a text html tag container which is strong or a, beside text there is an icon. here's my jQuery code:
$('#arrow-collapse').click(function() {
//hide the text
});
$('#arrow-show').click(function() {
//show the text
});
hidestyle/css to.<a>tag to store the original text, and a data attribute to store the status of the text, either visible or hidden. Then on click you either remove the text or add it. I would advise against it and just add a <span> around the text.