Lets say that I have a <p id"myid"> tag where I know the background is #FFFFFF, can I do something like

Code JavaScript:
if (document.getElementById("myid").style.background=="#FFFFFF")
{
do this;
}

if so, how is it done, since I tried it the way explained above and it does not work for me.

I know it sounds weird what Im trying to do but I would like to figure a way