<style type="text/css">
td.a{
background: yellow
}
</style>
<table><td class="a"></td></table>
Above is a html/css code snippet. From it, you can know that the background colour of td portion is in yellow.
Later, I have added a html select drop down component. I hope to change the background colour from yellow to blue when I select another select drop down value. but I do not know how to do.
This should be a question related to changing css through Javacript. It is quite similar with this How to change HTML background with JavaScript Function? but u can see that my td component does not have id, it just has class.
Hope someone can help me, thank you.
tdanid, or usedocument.getElementByClassName. Edit: for your reference