What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-03 20:32:07
useref in functional component
/* A common use case is to access a child imperatively: */ function TextInputWithFocusButton() { const inputEl = useRef(null); const onButtonClick = () => { // `current` points to the mounted text input element inputEl.current.focus(); ... Add solution -
Javascript 2021-10-03 19:08:02
mozilla observer onclick
var observeDOM = (function(){ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; return function( obj, callback ){ if( !obj || obj.nodeType !== 1 ) return; if( MutationObserver ){ // define a new observer... Add solution -
Html 2021-10-02 19:16:03
windows pop up
<!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-10-01 15:13:08
what does useref do react
/* A common use case is to access a child imperatively: */ function TextInputWithFocusButton() { const inputEl = useRef(null); const onButtonClick = () => { // `current` points to the mounted text input element inputEl.current.focus(); ... Add solution -
Javascript 2021-09-30 02:12:04
event bubbling in javascript
<script> form.onclick = function(event) { event.target.style.backgroundColor = 'yellow'; // chrome needs some time to paint yellow setTimeout(() => { alert("target = " + event.target.tagName + ", this=" + this.tagN... Add solution -
Javascript 2021-09-28 19:26:04
javascript document.createElement add function
var newTH = document.createElement('th'); newTH.innerHTML = 'Hello, World!'; newTH.onclick = function () { this.parentElement.removeChild(this); }; var table = document.getElementById('content'); table.appendChild(newTH); Add solution -
Javascript 2021-09-28 10:36:06
how to get values from select multiple in js
document.getElementById('submit').onclick = function() { var selected = []; for (var option of document.getElementById('pets').options) { if (option.selected) { selected.p... Add solution
Best helpers
Ranking is empty