Skip to main content

JavaScript

Simple JavaScript Counter

Submitted by admin on Mon, 06/06/2022 - 21:38

In this JavaScript tutorial we will create a simple counter with few buttons. On clicking the buttons, the value of counter will increase or decrease.

Create Counter with Few Buttons

Below code will create a region where the counter value will be displayed. And 4 buttons that will call a JavaScript function on click. On clicking these buttons the value of counter will increase or decrease.
We will also create a reset button.

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

Submitted by admin on Mon, 06/06/2022 - 21:36

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.

Subscribe to JavaScript