hexonaut / haxe-dom

A cross-platform implementation of the DOM. Built to reduce duplicate code across server and client.
MIT License
47 stars 4 forks source link

Problem adding style using .attr(Attr.Style, ... #21

Closed cambiata closed 10 years ago

cambiata commented 10 years ago

Hi Sam!

I'm getting some unexpected result when trying to set styling info. When writing this: var div = new EDiv(); div.attr(Attr.Style, 'width=100px;'); the resulting html is as follows: <div ... style="__s:width=100px;;length:12;">

Bug or feature? :-)

/ Jonas

hexonaut commented 10 years ago

Feature.

Style is not accessed that way. I should probably remove the Attr.Style to remove this confusion.

You should be writing:

div.node.style.width = "100px";

See: https://github.com/Blank101/haxe-dom/blob/master/src/hxdom/html/CSSStyleDeclaration.hx

cambiata commented 10 years ago

Ah, feature then..! :-) Fair!

Thank you!