W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: Mutation events replacement

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Wed, 20 Jul 2011 18:42:31 +0200
To: Dave Raggett <dsr@w3.org>
Cc: public-webapps@w3.org
Message-ID: <4e0e27daaopi712jvcvi97jsgg0rps4eo0@hive.bjoern.hoehrmann.de>
* Dave Raggett wrote:
>Perhaps we need to distinguish auto generated attributes from those that 
>are set by markup or scripts. Could you please clarify for me the 
>difference between the html "style" attribute and the one you are 
>referring to?  My understanding is that the html style attribute is set 
>via markup or scripts and *doesn't* reflect all of the computed style 
>properties for this DOM node.

You can manipulate the style attribute using DOM Level 2 Style features
like the ElementCSSInlineStyle interface instead of setting the value
as a string as you would when using .setAttribute and similar features.

  onload = function() {
    var p = document.getElementsByTagName('p').item(0);
    p.style.margin = '0';

This would alert something like `margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px` or `margin: 0px;`.
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Wednesday, 20 July 2011 16:42:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:22 UTC