What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-26 03:22:05
aframe react
import 'aframe';import 'aframe-particle-system-component';import {Entity, Scene} from 'aframe-react';import React from 'react';import ReactDOM from 'react-dom'; class VRScene exten... Add solution -
Javascript 2022-01-25 05:40:33
javascript trigger button click using class name
//The following code assumes that the given element has both of those classes; document.querySelector('.rateRecipe.btns-one-small').click(); //In the following code, the space is meant to imply an ancestor-descendant relationship document.querySelector('... Add solution -
Javascript 2022-01-23 01:42:00
javascript 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 2022-01-22 19:41:14
addeventlistener js to change style
var button = document.querySelector("button"); button.addEventListener("click", function() { const curColour = document.body.style.backgroundColor; document.body.style.backgroundColor = curColour === 'red' ? 'blue' : 'red'; }); Add solution