//YOU NEED TO DO A LOOP OF THE ELEMENTS
var elements = document.getElementsByClassName('editp');
for(var i=0; i<elements.length; i++) {
elements[i].style.display='none';
}
document.getElementById("myDIV").className = "mystyle";
let element = document.querySelector('.preset');
let style = getComputedStyle(element);
let bg = style.backgroundColor;
var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; i++) {
if (spans[i].className == 'xyz') {
spans[i].style.backgroundColor = '#000';
}
}