adding styling to element using javascript
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';
document.getElementById("myH1").style.color = "red";
Also in JavaScript:
- setinterval vs settimeout js
- web worker multiple data
- generate random whole numbers within a range
- if string javascript
- how to create react app in vs code
- javascript press tab key
- checking object is empty in JS
- how to find and remove object from array in javascript
- how to print console in javascript
- getboundingclientrect() javascript
- remove duplicates in json in flutter
- js detect cmd+s
- javascript get last url segment
- return object list in find js
- get last day of month javascript
- jest timeout
- Javascript compare two objects
- string concat javascript
- js save and load an array of different types into localstorage
- JavaScript that executes after page load
- lastindexof js
- current window url jquery
- split array by character javascript
- jquery see if element is visible