someone worked with changing the opacity on the selected contentEditable element.
I tried the following:
document.execCommand('foreColor', false, 'rgba(0,0,0,0.5)'); // with rgba document.execCommand('foreColor', false, '80000000'); // with alpha hex
nobody worked. but I can easily change the color with:
document.execCommand('foreColor', false, '000000');
Can someone help me in changing the opacity using document.execCommand?
Update
A further search revealed:
document.execCommand 'foreColor' add a font tag to the selected one with the specified color. But unfortunately, the color attribute is not supported in HTML5.
This is problem? What is its alternative?
source share