Skip to content

How to programmatically change the thumbnail color? #115

Answered by mdbassit
Turtleted21 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

First you need to update the color value in the input field:

document.getElementById("color-changer").value = "#ff00ff";

Then trigger an input event on the field:

document.getElementById("color-changer").dispatchEvent(new Event("input", { bubbles: true }));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdbassit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #114 on July 11, 2023 14:14.