What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-16 20:50:06
JAVASCRIPT EVENT.TARGET
Using the event.target property together with the element.tagName property to find out which element triggered a specified event: <body onclick="myFunction(event)"> <p>Click on any elements in this document to find out which element... Add solution -
Javascript 2022-01-31 13:45:38
javascript document DOMContentLoaded event
<!DOCTYPE html> <html> <head> <title>JS DOMContentLoaded Event</title> <script> document.addEventListener('DOMContentLoaded', () => { let btn = document.getElementById('btn'); ... Add solution -
Other 2022-01-22 14:50:23
how to repeat function on long click in android
import android.os.Handler; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; /** * A class, that can be used as a TouchListener on any view (e.g. a Button). * ... Add solution -
Other 2021-11-17 09:19:28
flutter how to add ontap on container
You can wrap your Container in an InkWell or GestureDetector. The difference is that InkWell is a material widget that shows a visual indication that the touch was received, whereas GestureDetector is a more general purpose widget that shows no visual ind... Add solution -
Other 2021-11-16 02:10:08
app-root modal component
// These two containers are siblings in the DOM const appRoot = document.getElementById('app-root'); const modalRoot = document.getElementById('modal-root'); class Modal extends React.Component { constructor(props) { super(props); this.el = doc... Add solution -
Javascript 2021-11-13 15:06:11
simple redux implementation
// simplified createStore function const createStore = (yourReducer) => { let listeners = []; let currentState = yourReducer(undefined, {}); return { getState: () => currentState, dispatch: (action) => { currentState = yourRe... Add solution -
Javascript 2021-11-13 00:47:19
javascript change multiple images onclick
<h2>Change image onClick event here...</h2> <img src="imageName1.jpg" onmouseover="imagefun()" id="getImage"> <script> function imagefun() { var Image_Id = document.getEl... Add solution -
Javascript 2021-11-11 23:59:24
what is e.target in javascript
Using the event.target property together with the element.tagName property to find out which element triggered a specified event: <body onclick="myFunction(event)"> <p>Click on any elements in this document to find out which element... Add solution -
CSS 2021-11-10 14:01:16
How to add object in an array using useState
import React, { useState } from 'react'; function App() { const [items, setItems] = useState([]); // handle click event of the button to add item const addMoreItem = () => { &nb... Add solution
Best helpers
Ranking is empty