I have an HTML element whose background colour is set with rgba()
T
You got the string, replace whatever 'rgba(1,1,1,0.3)'.replace(/[^,]+(?=\))/, '0.5')
'rgba(1,1,1,0.3)'.replace(/[^,]+(?=\))/, '0.5')