Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

add css on click javascript

document.querySelector('#image').addEventListener('click', () => {
  document.querySelector('#foo').classList.add('myClass');
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: if datatable is null js 
Javascript :: javascript read server file 
Javascript :: javascript absolute path 
Javascript :: how to print object in JavaScript, Object print in JavaScript 
Javascript :: js new date short format 
Javascript :: get object value in node js 
Javascript :: get closest element id jquery 
Javascript :: access css property using javascript 
Javascript :: javascript run command 
Javascript :: javascript regex replace 
Javascript :: three js render 
Javascript :: mmap() failed: [12] Cannot allocate memory composer 
Javascript :: remove node modules command windows 
Javascript :: 2d array to 1d array javascript 
Javascript :: react yup password with number string and uppercase 
Javascript :: multiple records in json 
Javascript :: xmlhttprequest javascript 
Javascript :: redirect if not logged in next js 
Javascript :: count number of word in javascript 
Javascript :: change innertext javascript 
Javascript :: vowel array 
Javascript :: list all functions in an object js 
Javascript :: authfunctions 
Javascript :: .children javascript 
Javascript :: generating random number in javascript 
Javascript :: active nav links in next.js 
Javascript :: useSearchParams 
Javascript :: javascript sort by date descending 
Javascript :: datatables filter with math functions 
Javascript :: regex expression for password validation form validation 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =