I executed but only FF and chrome moves the textarea 0px from top and 0px from left but in IE textarea is in default position.
Here is my code:
publi
Don't set style
via setAttribute
. In JavaScript the style attribute is actually an array. Thus depending on how smart the browser is and understands you want to set the style attributes it will work by setting style
or won't work.
You should set style attributes individually via getElement().getStyle().setProperty()
. Or use the specific methods, like: ta.getElement().getStyle().setPosition(Position.ABSOLUTE)
or via the setProperty method: ta.getElement().getStyle().setProperty("position", "absolute")
. And the same for the 2 other properties. See the Style
class for what specific methods are supported.
What about using style classes? I mean, you can write a style class like this:
.someClass {
position:absolute;
top:0px;
left:0px;
}
And then add the style class to the TextArea
ta.addStyleName("someClass");
It will help you to write a more concise code, without inline styling that could be difficult to maintain.