W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2012

Element.style setter

From: João Eiras <joaoe@opera.com>
Date: Mon, 27 Aug 2012 11:41:33 +0200
To: "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <op.wjo07jwe2q99of@joaoe>

Hi !

Opera allows element.style to be set with a css fragment, like

# element.style = 'background:green'

which maps to

# element.setAttribute('style', 'background:green');

Others do not support this (throw an error due to being a read-only  
property), but it makes the code less verbose.

How about allowing this in DOM 4 ?

Thanks.
Received on Monday, 27 August 2012 09:42:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 August 2012 09:42:08 GMT