Just wrap the text in (invisible)
and use jQuerys.width () to get the width.
Please note, you should not, like others, use
it as it is a block element and depending on where / how you insert it, the block element can automatically expand to its full available width and give bad results.
source to share