How can I change the css properties of a H1 tag dynamically using js or jquery. I mean if suppose I have a H1 tag with class fh and another H1 tag with class sh how can I change the font-size, color seperatly. I have make one but not working. How can I achive that?
const inputs = document.querySelectorAll('.controls input');
function handleUpdate() {
const suffix = this.dataset.sizing || '';
document.documentElement.style.setProperty(`${this.name}`, this.value + suffix);
}
inputs.forEach(input => input.addEventListener('change', handleUpdate));
inputs.forEach(input => input.addEventListener('mousemove', handleUpdate));
Here is my fiddle
UPDATE : how can I do this by dynamically sensing the h1 or p tags in my fiddle there is a range slider I want that when I click on h1 the current value ( properties ) of my h1 come in the range sliders respectively and I can edit them