What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-16 03:41:16
how to create an event calendar in javascript
mobiscroll.settings = { lang: '' theme: 'ios', themeVariant: 'light' }; var monthInst, dayInst, popupInst, dateInst, preventSet, allDaySwitch = document.getElementById('allDay'), eventTextInput = document.getElementByI... Add solution -
Javascript 2021-11-14 19:51:19
how to use get Element without document
// You can use querySelector -> //first get your element with query or getelement let element = document.getElementById('id'); let element = document.querySelector('#id'); //you can use query on this element to only get element from this element //w... Add solution -
Javascript 2021-11-14 13:47:19
document style
var elem = document.querySelector('#some-element'); // Set color to purple elem.style.color = 'purple'; // Set the background color to a light gray elem.style.backgroundColor = '#e5e5e5'; // Set the height to 150px elem.style.height = '150px'; Add solution -
Javascript 2021-11-14 00:15:23
cache variables that need calculation
// In the case of a jQuery selector, we could cache the DOM element. let navright = document.querySelector('#right'); let navleft = document.querySelector('#left'); let navup = document.querySelector('#up'); let navdown = document.querySelector('#down'); 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 -
Html 2021-11-10 16:32:13
html change player speed
document.querySelector('video').playbackRate = 1.25; Add solution -
Javascript 2021-11-10 15:22:15
javascript get form data as json
function handleSubmit(event) { event.preventDefault(); const data = new FormData(event.target); + const value = Object.fromEntries(data.entries()); console.log({ value }); } const form = document.querySelector('form'); form.addEventListene... Add solution
Best helpers
Ranking is empty