I am able to update the HTML using this JavaScript outside the ‘on click’ action, but when I put it inside the ‘on click’ action, it doesn’t work. I know the code is executing the ‘on click’ action, because that’s how I am changing the background color.
Any help would be appreciated!
(Code is executing Test1, Test2, Test3 text, but not Test4 text)
The first line was fine. It didn’t like it 'cause there’s no such thing as document.html. To target the html element in Javascript it should be document.documentElement.
Aside from that, since you’re giving a 100% height to the body and html, you don’t really need to change the html background-color; doing it to the body will be enough.
Lastly, when using jQuery, if you want to change the same property on different elements, you can group your selectors like:
HI this is my code for me the button click is not working for any sample code that i writing. could you please let me know whether it is a problem with my code or i have to perform any browser settings.