@toicontienSep 12.2007 — #That all depends on the character encoding you are using. Every string variable in JavaScript has a property called .length that tells you how many characters are in the string. If you are using UTF-8 on the web page, you can estimate the size in bytes by multiplying the number of characters in the string by 8 and dividing by 8 (UTF-8 is generally 8 bits per character).
Basically, multiply the number of characters by how many bits make up one character in whichever character set is being used on the page, and divide that number by 8. number_of_chars * bits_per_char_in_character_set / 8