Measure text size in JavaScript
- by kayahr
I want to measure the size of a text in JavaScript. So far this isn't so difficult because I can simply put a temporary invisible div into the DOM tree and check the offsetWidth and offsetHeight. The problem is, I want to do this BEFORE the DOM is ready. Here is a stub:
<html>
<head>
<script type="text/javascript">
var…