javascriptjquerytrimtexttrimming

Jquery check input trim


How can i create a custom function in jquery?

I want to use that on text inputs, to check with trim, that the user really entered some text, or just white spaces.


Solution

  • You can use .trim() function.

    if ($.trim($("input-selector").val()))
    {
       //do Something
    }