Trim to remove white space

Akhil K Nambiar picture Akhil K Nambiar · Oct 28, 2010 · Viewed 183.6k times · Source

jQuery trim not working. I wrote the following command to remove white space. Whats wrong in it?

var str = $('input').val();

str = jquery.trim(str);
console.log(str);

Fiddle example.

Answer

Jason picture Jason · Oct 28, 2010

jQuery.trim() capital Q?

or $.trim()