I have a page I'm coding but I'm new to Javascript. Due to an error in the page, I have to set the body,html
element background color to transparent in order to achieve the look I want on the mobile page. I wish to achieve this through JavaScript to change as little CSS as possible from the original coding. After doing some research here:
How to get elements with multiple classes
This what I have so far:
var x = document.querySelectorAll('body, html');
x.style.backgroundColor = "transparent";
Unfortunately, this is raising an undocumented exception/error. The reason I suspect is that the syntax "('body, html')
" is not correct in this case and is thus providing me with the wrong element or no element at all. My real issue with this problem is that I'm not actually looking for class names or IDs but for the body and HTML tags, which are top-level top level elements in the dom.
Any help anyone can be with this would be a huge aid to me.