user6506939 user6506939 - 5 months ago 9
HTML Question

How to use RGBA in an onmouseleave event?

This doesn't seem to work when changing the background of a table in HTML:



onmouseleave="this.bgColor='rgba(24,58,0,0.85)'"


Do I have the syntax wrong?

Answer

Try it:

this.style.backgroundColor='rgba(24,58,0,0.85)';