How can i hide list items first and then click the ul to show the list item | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How can i hide list items first and then click the ul to show the list item

11th Oct 2017, 5:39 AM
DarshOP
DarshOP - avatar
2 Answers
+ 3
Darsham, Calvin 's solution is very compact. If you would like a solution which uses javascript you could look at the way I use the info icon in some of my codes. Try https://code.sololearn.com/WUypXN700o3V/#html
11th Oct 2017, 9:35 AM
Richard Myatt
Richard Myatt - avatar
+ 2
Try this: <a onclick="this.children[0].style.display='block'">Show <ul style="display:none"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </a> https://code.sololearn.com/W78r9VTZnG0d/?ref=app
11th Oct 2017, 6:29 AM
Calviղ
Calviղ - avatar