Answers for "how to change background color using button in javascript"

0

javascript change color of button

document.getElementById("button").style.background='#000000';
Posted by: Guest on November-13-2020
2

how to change background color using js

var warning = document.getElementById("warning");
  warning.style.background-color = "red";
Posted by: Guest on August-30-2020
1

change background color on button click in javascript

<style>
  .bg1 {
  	background-color: red;
  }
</style>

<button id="btnChangebgColor" />

<script>
  	$(document).ready(function(){
      $("#btnChangebgColor").click(function() {
        $(this).addClass(".bg1");
      }); 
	}
</script>
Posted by: Guest on March-17-2021

Code answers related to "how to change background color using button in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language