x.xxx 1,
var element = $("#id")
element.css('backgroundColor', element.css('backgroundColor').replace(/(\d\.?\d*)\s*\)/i, "1") )
1 .
Please note that your color must be in the format "rgba (100, 100, 100, 0.85098)" from the very beginning
source
share