I have a small question in my project that I am developing.
I need to make certain <article>
appear when a particular <li>
is clicked.
Example
<li>
's
<li id="menu-CARD">USAR CARD</li>
<li id="menu-SLIP">USAR SLIP</li>
Example
<article>
's
<article id="CARD">CONTEÚDO CARD</article>
<article id="SLIP">CONTEÚDO SLIP</article>
I need two things.
- 1 ° When you click on one of the
<li>
, add the class " selected " to<li>
clicked. (% with%) - 2 ° When you click on a
class="selected"
, the<li>
that is referred to this<article>
that was clicked.
Example: When you click on the% "USE SLIP"% :
<li id="menu-SLIP">USAR SLIP</li>
A style="display: block" will be added to the slip% :
<article id="SLIP">CONTEÚDO SLIP</article>
Looking like this:
<article id="SLIP" style="display:block">CONTEÚDO SLIP</article>
Observer:
Your function will look like a tab.
When you click on USER CARD, you will see the% of id CARD .
When you click on USE SLIP, you will see% s of SLIP .
That is, while one display: block receives the other, display: none .