Here is a link to my pen: http://codepen.io/anon/pen/IszKj
I am looking to achieve the functionality where clicking on either "any status" or "any date" will reveal a hidden div containing a list of options.
My main query is about the best approach to take in implementing this feature.
- Should I have two separate divs and open the one corresponding to the clicked list item?
<div id="status" style="display: hidden">Option 1 Option 2</div>
<div id="date" style="display: hidden">Option 1 Option 2</div>
- Alternatively, should I use a single div and display only the relevant content for that button click?
<div style="hidden">
<span id="status">...</span>
<span id="date">...</span>
</div>
Moreover, I'm unsure whether to utilize toggle
or the conventional open
/ close
function.
Lastly, it would be ideal if the functionality gracefully degrades when JavaScript is disabled.