Here we are going to discussing about how to find the length of string, it is very simple thing to know the length of string check the below code with description. okay let see the code below in the first line button code is including on click event (event name is myfunction), with using this myfunction in java script code called function name called myfunction and creating variable called "str" value is "hello Good Morning" with length property. one more thing getting the value from getElementById(display) value will display in which div has display id.
var str="Hello Good Morning!";