IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes Word size Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Word size" Watch "Word size" New topic
Author

Word size

Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
Is there any way to calculate the size of a word, using javascript, doing just the same as class FontMetrics would do, but to HTML words???
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
with javascript you can tell the size of a string by the length attribute
TheStr="Hello"
TheLen=TheStr.length;
alert(TheLen);
Eric
 
 
subject: Word size
 
Threads others viewed
applet image problem
New Words ... word of the day topic?
Your most hated word
that class from Grains...
WA #1.....word association
IntelliJ Java IDE