Create a Collapsible element using JavaScript

Sometimes hiding or showing some content to the user is to be decided. For instance, you are writing down the review of a movie and you don’t want the user to know the suspense by default. So, you can tell the user that this is a Spoiler Alert. If the user wants to read it, he or she can read it otherwise it will remain hidden to the user! Making such a thing is pretty easy but requires you to decide if you want the user to see the data by default or it must remain hidden by default. It totally depends on your application of this tip. Well, let’s get started writing down some basic HTML and CSS first. If you already don’t use Notepad++ for writing your codes, I recommend you to go ahead and get that at first. Read more about Notepad++ in my earlier article. ...

October 24, 2013 · 3 min · Aneesh Bhatnagar