I have an element like this:
<p>My text with a <strong class="highlighted">sample highlight</strong>.<p>
And the CSS class like this:
.highlighted {
background: #f0ff05;
font-weight: normal;
}
But when I use a jQuery like this:
$(".highlighted").css("backgroundColor");
It returns rgb(240, 255, 5)
. I could write some function to convert from rgb to hex, but I would like to know if there is some way to jQuery return the value already on hexadecimal format.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…