document.getelementbyid use in javascript code example
Example 1: javascript getelementbyid
const element = document.getElementById('id');
//or
const element = document.querySelector('#id');
Example 2: document.getElementById
function changeColor(newColor) {
var elem = document.getElementById('para');
elem.style.background-color = newColor;
}