Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to use javascript so the color box change color and then change back

var btn = document.getElementById("#btn");
var box = document.getElementById("#box");

function changeColor() {
  box.style.backgroundColor = "red";
}

function ifColor() {
  if (box.style.backgroundColor == "red") {
    box.style.backgroundColor = "blue";
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: get time from excel javascript 
Javascript :: changing state in useeffect...Avoid rerender because of useeffect....Call useEffect only once....Infinite loop useEffect 
Javascript :: grommetjs remove green over buttons 
Javascript :: 10.3.1. Function Syntax 
Javascript :: javascript ligten a color 
Javascript :: express js jump to above directory 
Javascript :: node sass how to configure number of spaces 
Javascript :: underscore filter array of objects 
Javascript :: dynamically populate vue material table 
Javascript :: fastselect clear select 
Javascript :: how to convert serilazed data to json in js 
Javascript :: remove 0 from 01 
Javascript :: serverless unsupported function event 
Javascript :: next field 
Javascript :: settimeout react native focus text input 
Javascript :: Chaining methods in jShell 
Javascript :: js return vs break in for loop 
Javascript :: fat arrow return object 
Javascript :: typeerror: chogigabsi eobnun bin beyole dehan recudenun error. 
Javascript :: compile pdf with javascript 
Javascript :: react first click not working 
Javascript :: value 
Javascript :: VueJs System Modifier keys like exact ctrl alt shift meta 
Javascript :: how is coa useful npm 
Javascript :: readfle nodejs 
Javascript :: check if key in dictionary javascript 
Javascript :: get size widget renderbox 
Javascript :: when reload the page the route gone in react js laravel 
Javascript :: silk carousel jquery 
Javascript :: eleventy stringify 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =