What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-08-30 17:41:01
apply css media query using js
function myFunction(x) { if (x.matches) { // If media query matches document.body.style.backgroundColor = "yellow"; } else { document.body.style.backgroundColor = "pink"; } } var x = window.matchMedia("(max-width: 7... Add solution -
Javascript 2021-08-28 23:05:01
change the body background color with javascript checkbox using
blue=document.getElementsByClassName("check1")[0] red=document.getElementsByClassName("check2")[0] yellow = document.getElementsByClassName("check3")[0] function colors(color) { document.body.style.backgroundColor = color... Add solution -
Other 2021-08-27 20:25:02
onfocus
//The onfocus event occurs when an element gets focus Enter your name: <input type="text" onfocus="myFunction(this)"> <p>input field gets focus & a function is triggered changes the background-color.</p> <scr... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5