get lenght of text in javascript code example Example: get lenght of text in javascript var str = "Hello World!"; var n = str.length;