I have a parent element which in this case is a div element and within this div has dynamic content added. So I never know if within the div there could be paragraphs, headings, divs, spans.
I want to make it so I can let the user increase the size of the text to all content within a particular parent div.
Is this possible to do without knowing the content for sure, though the content (html tags) cannot be something that is not: paragraph, heading, divs, span?
My current code looks like following:
const nodes = document.querySelectorAll('#content');
nodes.forEach(a => {
a.style.fontSize = newSize + "%";
});
This works for changing font size of text within child divs, but doesn't work for paragraphs or heading.
Any idea how to achieve this?