Home > Mobile >  Trying to make a custom changeable background
Trying to make a custom changeable background

Time:09-28

I want to make a changeable background with a button and menu like on the new tab page that google has can you help

CodePudding user response:

Just have the button click set the class to the body tag.

CodePudding user response:

Have the button click by setting an event listener to it

btn stands for the variable referencing the button element. It's just a personal preference, you can name the variable your choice.

btn.addEventListener("click", function(){
  // code to be executed
}

  • Related