In this HackerRank Day 8: Create a Button 10 days of javascript problem solution we need to create buttons in the javascript.

HackerRank Day 8: Create a Button problem solution

Problem solution in JavaScript programming.

CSS file.

.btnClass {

    width: 96px;

    height: 48px;

    font-size: 24px;


JavaScript file

var btn = document.createElement("Button");

btn.innerHTML = "0"; = "btn";

btn.className = "btnClass";


btn.onclick = function() {



HTML file

<!-- Enter your HTML code here -->

<!DOCTYPE html>



        <meta charset="utf-8">