tags:

views:

36

answers:

3

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

var str = $('#txtbox').val();
str = jquery.trim(str);
$('#txtbox').val(str);
+4  A: 

jQuery.trim() capital Q?

or $.trim()

Jason
thanks..... very much... i was stuck by using small Q
Akhil K Nambiar
haha! That's why I use `$.` instead of `jQuery.` At least you got it fixed!
Jason
A: 

see the below method it should work print str...in console or alert and check

http://api.jquery.com/jQuery.trim/
gov
why the above link not useful , it shows the API...
gov
I didn't down-vote, but I assume because you didn't answer the question. This is better suited for a comment, not an answer.
Jason
@jason Thats fine no problem, i thought documentation is useful for him as there was some example also there
gov
He was already aware of the API, just not using it correctly. As Jason said, this really doesn't answer the question.
Matthew Flaschen
A: 

or just use $.trim(str)

Moin Zaman