I have a default color value of "#202124" and I use JavaScript to programmatically change it to "#ff0000" when the page refreshes. However, when I check the HTML in the console, it shows that the selected color has been changed, but it does not reflect on the screen.
Here are the code snippets:
The input element has a class "bg_color_input_Class" and a default value of "#202124".
I use the JavaScript code below to change the value to "#ff0000":
var inputElementBgColorDark = document.getElementById("background_color_dark");
inputElementBgColorDark.setAttribute("value", "#ff0000");
I have a default color value of "#202124" and I use JavaScript to programmatically change it to "#ff0000" when the page refreshes. However, when I check the HTML in the console, it shows that the selected color has been changed, but it does not reflect on the screen.
Here are the code snippets: The input element has a class "bg_color_input_Class" and a default value of "#202124".
I use the JavaScript code below to change the value to "#ff0000": var inputElementBgColorDark = document.getElementById("background_color_dark"); inputElementBgColorDark.setAttribute("value", "#ff0000");
Could you give me a little clue on how to fix it?