Mike's JavaScript Crib Sheet

String Methods/Properties: value can be compared to "" for an empty input note that spaces aren't considered to be empty
indexOf( CharToFind, IndexOfStartingChar)
returns the index of the first CharToFind that occurs in the string after IndexOfStartingChar, or "-1" if it can't find any more
charAt( Index )
Returns the character at Index in the string
length Property
Number of characters in the string

Function Args:
FunctionName[i]
fetches the ith argument to the function FunctionName Useful for iterating through variable-arg functions
FunctionName.length Property
Returns the number of arguments to the function FunctionName

Using JS to check form inputs

Form Element Methods/Properties
focus()
sets the focus to be the form element
select()
Selects the text in a text form element