Stop Firefox rendering inline colours in rgb() form

前端 未结 3 805
Happy的楠姐
Happy的楠姐 2021-01-20 15:29

I\'m trying to write a JavaScript tool to work on items of a certain colour. On a test page, I set the colour using an inline style, to mimic the target pages, but when the

3条回答
  •  梦谈多话
    2021-01-20 16:08

    This is not a conversion, it's just a different way of expressing the same thing. If you want to check for a particular colour, you will have to first express it in rgb format, then do the check. As far as I am aware, the css value returned for a DOM element is whatever it is - you cannot change the format.

提交回复
热议问题