These attributes are completely compatible with IE Firefox. If you do not need to mention them, you can see the test results:
[Source code]
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> </title>
<SCRIPT type = "text/JavaScript">
Function position (Eve ){
VaR T = Document. getelementbyid ("div1 ");
VaR E = Eve | event;
VaR divoffsettop = T. offsettop; // = Top + marginwidth = 100 + 3 = 103
VaR divoffsetleft = T. offsetleft; // left + marginwidth = 50 + 3 = 53
VaR eventtop = E. clienty;
VaR eventleft = E. clientx;
VaR divtop = T. style. Top;
VaR divleft = T. style. Left;
VaR divclienttop = T. clienttop; // borderwidth
VaR divclientleft = T. clientleft; // borderwidth
VaR divclientwidth = T. clientwidth; // width + 2 paddingwidth = 200 + 2*11 = 222
VaR divclientheight = T. clientheight; // height + 2 paddingwidth = 300 + 2*11 = 322
VaR divoffsetwidth = T. offsetwidth; // = 2 borderwidth + width + 2 paddingwidth = 2*7 + 200 + 2*11 = 236
VaR divoffsetheight = T. offsetheight; // = 2 borderwidth + height + 2 paddingwidth = 2*7 + 300 + 2*11 = 336
VaR bodyclienttop = Document. Body. clienttop;
VaR bodyclientleft = Document. Body. clientleft;
VaR divwidth = T. style. width;
VaR divheight = T. style. height;
VaR divborderwidth = T. style. borderwidth;
VaR divpaddingwidth = T. style. padding;
VaR divmaginwidth = T. style. margin;
VaR r = "divoffsetleft:" + divoffsetleft + "-- divoffsettop:" + divoffsettop; // 103 53
R + = "\ neventleft:" + eventleft + "-- eventtop:" + eventtop; // >=103> = 53
R + = "\ ndivleft:" + divleft + "-- divtop:" + divtop; // 100px 50px
R + = "\ ndivclientleft:" + divclientleft + "-- divclienttop:" + divclienttop; // 7 7
R + = "\ nbodyclientleft:" + bodyclientleft + "-- bodyclienttop:" + bodyclienttop; // 5
R + = "\ ndivclientwidth:" + divclientwidth + "-- divclientheight:" + divclientheight; // 222 322
R + = "\ ndivwidth:" + divwidth + "-- divheight:" + divheight; // 200 300
R + = "\ ndivoffsetwidth:" + divoffsetwidth + "-- divoffsetheight:" + divoffsetheight; // 236 336
R + = "\ ndivborderwidth:" + divborderwidth // 7px
R + = "\ ndivmaginwidth:" + divmaginwidth // 3px
Alert (R );
}
</SCRIPT>
</Head>
<Body>
<Input type = "button" id = "BTN" value = "test location"/>
<Br/>
<Div id = "div1" line-Height: normal; ">
Top: 50px; left: 100px; Border: 7px solid red; padding: 11px; margin: 3px; "onmousedown =" position (event) ">
This isArticleThis is the content of the article.
This is the content of the article.
This is the content of the article.
</Div>
</Body>
</Html>