The following section describes how to remove string spaces by using jquery $. trim ]. I think it is quite good. Now I will share it with you and give you a reference. Let's take a look at it with xiaobian.
Implementation of jquery $. trim () to remove string spaces [legend]
Syntax
The jQuery. trim () function removes spaces at both ends of a string.
Function
This function can remove the white spaces at the start and end of the string (until the first non-white string is encountered ). It clears common blank characters including line breaks, spaces, and tabs.
Parameters
If the str parameter is not of the string type, this function automatically converts it to a string (generally calls its toString () method ). If the str parameter is null or undefined, an empty string ("") is returned ("").
Return Value
The Return Value of the jQuery. trim () function is of the String type. The return value is the String after the blank strings at both ends are removed.
Example & Description
My JSP 'index. jsp 'starting page
ShowBtn ShowBtn1