JavaScript string objectLet us first declare a new string object like this.
Length property to get the length of the stringIt gives the total length of the string including blank spaces present in a string.
Making the string Bolddocument.write(my_string.bold());Declaring the font size of the stringdocument.write(my_string.fontsize(6));Making the string blink ( not work in IE )document.write(my_string.blink());Making TT type font with fixeddocument.write(my_string.fixed());Making the font color of the stringdocument.write(my_string.fontcolor("blue"));Changing to Italic fontdocument.write(my_string.italics());Adding a link to the string by linkdocument.write(my_string.link("https://www.plus2net.com"));Making the font style strike outDemo script using strike propertydocument.write(my_string.strike()); Getting a substring with start and end pointsdocument.write(my_string.substring(10,15));Making sub scriptdocument.write(my_string.sub());Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
![]() | ||
| ||