add active class onclick javascript

Solutions on MaxInterview for add active class onclick javascript by the best coders in the world

showing results for - "add active class onclick javascript"
Esteban
02 Mar 2018
1<!DOCTYPE html>
2<html>
3    <head>
4        <meta name="viewport" content="width=device-width, initial-scale=1">
5        <style>
6            .active {
7            padding: 5px;
8            background-color: #20BF55;
9            color: white;
10            }
11        </style>
12    </head>
13    <body>
14        <div id="text" onclick="makeActive()">
15            Click to make Active
16        </div>
17        <script>
18            function makeActive() {
19               var element = document.getElementById("text");
20               element.classList.add("active");
21               element.innerHTML="This is Active";
22            }
23        </script>
24    </body>
25</html>
26
queries leading to this page
when click add class active javascriptadd active class to li onclick javascriptonclick active classonclick add active class javascriptadd active class on button clickonclick add active classonclick add active class on div js add active class to div on clickonclick toggle active class javascriptadd active class on click buttonsjavascript on click add class activeset active class on clickassign active to button click with javascripton click to add class active jsadd active class javascriptadd active class on open page using javascriptjs on click class activeadd active class onclick javascript add active class onclick typescriptmake class active onclickjs function active class on clickhow to set onclick active class in jsadd active class on click css with jshow to add active class on click using javascripton click add active class jshtml onclick activebutton click class active jsadd active class to button onclickhow to add active class on click in html css and javascripton click active class jsjs add active class onclickjs onclick add class activegive active class on clickhow to add active class on clickchange active class onclick javascripton click add active classonclick add class activehow to set active class on clickadd active class on click javascriptadding active class on clickadding an active class onclick cssactive class js on clickonclick add active class in knockout jsassign active class on clickadding active class javascriptadd active class on click buttonchange active class on click in javascriptjavascript how to add active class on clickhow to add active class onclickon click active class addadd active class to clickedadd active class on clickjavascript add active class to current click eventon click set active classadd active class onclick javascript