I am trying to to calculate text width in px.
I will take a string from html, this string may contain some special characters as well (in this example just a hyphen), and make this string an html content of a div, and calculate string width.
But I am getting strange results.
If there is an better way to get text width, cross-browser!, please let me know.
I have made a fiddle:
Thank you!