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" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<span id="s1" >Some Text</span>
<span id="s2" style="font-Size:20px;" >Some Text</span>
</body>
<script type="text/javascript">
/*<![CDATA[*/
alert(document.getElementById('s1').offsetWidth);
alert(document.getElementById('s2').offsetWidth);
/*]]>*/
</script>
</html>
Bookmarks