I have a list that is unordered, and I am looking for a way to remove an option from the list if it is selected.
For Example:
If a user chooses one of the options from the list, I want that option to be removed as it will be considered the selected value. Is there a way to achieve this using jQuery or CSS? Can someone provide assistance?
The option gets removed successfully,
but the problem arises when if the user selects "A", and then later chooses "B", how can I add back the option "A" into the list?
Below you will find the HTML code snippet:
<dl id='assettypes' class="dropdown">
<dt>
<a href="#">
<span>
Select option
</span>
</a>
</dt>
<dd>
<ul id="ggg">
<li><a href="#">A</a></li>
<li><a href="#">B</a></li>
<li><a href="#">C</a></li>
<li><a href="#">D</a></li>
<li><a href="#">E</a></li>
</ul>
</dd>
</dl>