Primitives datatypes
-string -int -float -objects -undefined
===
sort comes from the arrary's protype - ability to add funtionality to an object that already exists in javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<form id="myForm" onsubmit= "return grabForm();" method="POST">
<h1>Login</h1>
<input id="name" type="text" name="username" value="" placeholder="Enter your name"><br/>
<input id="password" type="password" name="password" value="" placeholder="Enter your Password"><br/>
<button>SUBMIT</button>
</form>
<script>
function grabForm() {
var name = document.getElementById('name').value;
var password = document.getElementById('password').value;
if(name == null || name == ""){
alert('Please enter a name);
return false;
}
alert(name + " " + password);
}
</script>
</body>
</html>