Removes the leading and trailing white space and line terminator characters from a string.
Required. A String object or string literal. This string is not modified by the trim method.
The original string with leading and trailing white space and line terminator characters removed.
For an example that shows how to implement your own trim method, see Prototypes and Prototype Inheritance.
The following example illustrates the use of the trim method.
Supported in the following document modes: Internet Explorer 9 standards, Internet Explorer 10 standards, and Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.
Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards.