Alias to document.getElementById('DOMID'). $('elementID');
Returns object
Checks if a pattern exists in a string. "User passed test!".contains('passed');
"User passed test!"
Returns boolean
Strip whitespace (or other characters) from the beginning of a string. " Spaces before! ".trim();
" Spaces before! "
Returns string
Checks if string is a valid email address. "test@test.com".isEmail();
"test@test.com"
Returns boolean
Check if string is a valid host name. Hostnames must use a-z,0-9, and '-'. A hostname cannot have any spaces nor can it start with a '-'. "www.google.com".isHostname();
"www.google.com"
Returns boolean
Checks if string is a valid number. "-12345".isNumber();
"-12345"
Returns boolean
Reverse the order of the characters in a string. "abcdef".reverse();
"abcdef"
Returns string
Strip whitespace (or other characters) from the end of a string. " Spaces after! ".trim();
" Spaces after! "
Returns string
Find position of first occurrence of a string. "abcdef".strpos('c');
"abcdef"
Returns string
Return part of a string. See samples. "abcdef".substr(-2);
"abcdef"
Returns string
Replace text within a portion of a string. "abcdef".substrReplace('CD', 2, 2);
"abcdef"
Returns string
Retrieve a number from a string. "Update user #5555".toNumber();
"Update user #5555"
Returns string
Strip whitespace (or other characters) from the beginning and end of a string. " Spaces before and after! ".trim();
" Spaces before and after! "
Returns string
Truncates a string and adds trailing periods to it. "Description here, this is a very description.".truncate(10);
"Description here, this is a very description."
Returns string
Checks if a pattern, object, array exists in an array. ['a','b','c','d','e','f'].contains('d');
['a','b','c','d','e','f']
Returns boolean
Iterate through an array and execute function for each element in the array. ['a','b','c','d','e','f'].each( function(o, i){alert(o);} );
['a','b','c','d','e','f']
Returns void
Returns the value of the first element or FALSE for empty array. ['a','b','c','d','e','f'].last();
['a','b','c','d','e','f']
Returns mixed
Returns the value of the last element or FALSE for empty array. ['a','b','c','d','e','f'].last();
['a','b','c','d','e','f']
Returns mixed
© 2009 Nesbert Hidalgo. All rights reserved.