What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-22 03:40:37
javascript program for analog clock
const hourHand = document.querySelector('.hand-hour'); const minuteHand = document.querySelector('.hand-minute'); const secondHand = document.querySelector('.hand-seconds'); function getTime() { const now = new Date(); cons... Add solution -
Javascript 2022-03-18 04:50:03
how to click outside dom in javascript
// jQuery $(window).click(function() { //Hide the menus if visible }); // JavaScript const getBody = document.querySelector('body'); getBody.addEventListener('click', () => { //Hide the Menus if Visible }); // Stop Propogation on Element you want... Add solution -
Other 2022-03-10 02:40:09
on click unmount the component
import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; function LifecycleDemo() { // Pass useEffect a function useEffect(() => { // This gets called after every render, by default // (the first one, and every... Add solution -
Javascript 2022-03-05 12:30:03
javascript canvas grayscale
const img = document.querySelector('img'); const canvas = document.querySelector('canvas'); const ctx = canvas.getContext('2d'); img.onload = function() { canvas.width = img.width; canvas.height = img.height; ctx.filter = 'grayscale(1)'; ctx.draw... Add solution -
Javascript 2022-03-03 03:05:17
display form input on console jquery
var nameInput = document.getElementById('name'); document.querySelector('form.pure-form').addEventListener('submit', function (e) { //prevent the normal submission of the form e.preventDefault(); console.log(nameInput.value); }); Add solution -
Javascript 2022-02-28 11:45:17
get all visible text on website javascript
function isHidden(el) { var style = window.getComputedStyle(el); return ((style.display === 'none') || (style.visibility === 'hidden')) } // get the body tag var body = document.querySelector('body'); // get all tags inside body var allT... Add solution -
Javascript 2022-02-22 21:25:11
iterate over node object children
/* HTML */ /* <ul class="navigation__secondary" id="navigation-bar"> <li class="navigation__secondary-item"> <span>Item</span> </li> <li class="navigation__secondary-item active&... Add solution