Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


can i force jquery cssbackgroundcolor returns on hexadecimal format


can i force jquery cssbackgroundcolor returns on hexadecimal format  using -'jquery,rgb,hex,background-color'

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.
    

asked Oct 7, 2015 by android_master
0 votes
7 views



Related Hot Questions



Government Jobs Opening


...