Below is the HTML code with UL and LI elements:
<UL>
<LI><span id='select1'>Text</span></LI>
<LI><span id='select2'>Text</span></LI>
<LI><span id='select3'>Text</span></LI>
<LI><span id='select4'>Text</span></LI>
<LI><span id='select5'>Text</span></LI>
<LI><span id='select6'>Text</span></LI>
</UL>
When clicking on a specific <span>
, we want its background color to change. For example, clicking on the span with id='select3'
should change its background color.
Please provide guidance on how this can be achieved using jQuery.