Simple Modern JavaScript Accordion

You will find accordion contents on many modern websites. An accordion is a UI pattern where content is toggled between expanded and collapsed states. This allows web developer to show more information in a small area and in a modern style. Accordions are great for enhancing the usability of your site by saving space and keeping your content organized.

In this blog post, we’ll explore how to build a simple accordion using HTML, CSS, and JavaScript. Let’s dive right in!

Tags

JavaScript – Change Background Color to Any Random Colors on Button Click

In this JavaScript tutorial we will create a button that will change the background color of body to any random color on a button click. We will use just plain JavaScript, No JavaScript Library, No JavaScript Framework.

Create a Button

Let’s first create a button with ID color-button that will call a JavaScript function changeBg() on click.

Tags