What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-21 13:40:11
javascript-change color onclick()
const btn = document.querySelector('button'); function random(number) { return Math.floor(Math.random() * (number+1)); } btn.onclick = function() { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.st... Add solution -
Javascript 2022-02-13 15:35:08
How to display output in textbox in JavaScript
<!DOCTYPE html> <html lang = "en-US"> <head> <meta charset = "UTF-8"> <title>textBoxes.html</title> <script type = "text/javascript"> // from textBoxes.html function sayHi(){ ... Add solution -
Other 2022-01-30 01:25:48
session timeout minutes for in 1*60 *1000
var IDLE_TIMEOUT = 2700; //seconds 45min var _idleSecondsCounter = 0; document.onclick = function() { _idleSecondsCounter = 0; }; document.onmousemove = function() { _idleSecondsCounter = 0; }; document.onkeypress = function() { _idleSecondsCounte... Add solution -
Other 2022-01-29 03:10:16
how to use toast using bootstrap5
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" hr... Add solution -
CSS 2021-11-22 07:26:16
pop up animation css
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <button onclick = 'f=window.open("URL,exampe - google.com","fenetre","the style (wi... Add solution -
Javascript 2021-11-20 08:36:12
activar funcion js con id
// Función externa function muestraMensaje() { alert('Gracias por pinchar'); } // Asignar la función externa al elemento document.getElementById("pinchable").onclick = muestraMensaje; // Elemento HTML puede ser: input, button, ... Add solution -
Javascript 2021-11-20 07:31:10
react hide element
React circa 2020 In the onClick callback, call the state hook's setter function to update the state and re-render: const Search = () => { const [showResults, setShowResults] = React.useState(false) const onClick = () => setShowResults(true) r... Add solution