JQuery getting .css "background-color" in format # 000000?

I am using a jquery plugin that seems to need color in the "000000" format, but when I do this:

currentcolor = $("#" + dividediting).css("background-color");

I get output like:

rgb(0,0,0)

I am wondering if there is a way to change the way it exits or if I need to use a regular expression to parse the result to get it in the right format .. thanks for any advice

+3
source share
1 answer

This is a browser that returns the processed and processed color value; it has nothing to do with jQuery as such.

If you need to convert the value, see this question

rgb(x,z,y) CSS is also valid.

+3

Source: https://habr.com/ru/post/1755857/


All Articles