Use === Instead of ==
Use ‘var’ Before The Variable Name
While creating variables don’t forget to use the var keyword. If you forget this, the variable gets added to the global scope which is definitely a bad thing. Using the var keyword will limit the variable to the function, making it inaccessible outside of the function in which it’s declared.
Place The Scripts At The Bottom Of The Document
Don’t Use eval()