What do you want to save?
Add Code snippet
New code examples
-
Html 2021-11-04 21:51:12
remove active class from all li javascript
<!-- w3.js brings the simple and fast solution --> <script src="https://www.w3schools.com/lib/w3.js"></script> <ul> <li class="ready"> </li> <li class="ready"> </li> <l... Add solution -
Javascript 2021-11-03 14:24:09
change state in react
import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times</p> ... Add solution -
Javascript 2021-11-03 10:02:28
copy text on button click in jquery
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <p id="p1">P1: I am paragraph 1</p> <p id="p2">P2: I am a second paragraph</p> <button onclick=&... Add solution -
Other 2021-11-02 17:23:10
componentDidmount event on fonctional component
import React, { useState, useEffect } from 'react'; function Example() { const [count, setCount] = useState(0); // Similaire à componentDidMount et componentDidUpdate : useEffect(() => { // Met à jour le titre du document via l&r... Add solution -
Javascript 2021-11-02 12:11:12
reduce function snippets
/* The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value.*/ // Round all the numbers in an array, and display the sum: <button onclick="myFunction()">Get the Su... Add solution -
Javascript 2021-10-30 01:43:13
react how to scroll to element
import React, { useRef } from 'react' const scrollToRef = (ref) => window.scrollTo(0, ref.current.offsetTop) // General scroll to element function const ScrollDemo = () => { const myRef = useRef(null) const executeScroll = () => scrol... Add solution
Best helpers
Ranking is empty