1//add event.preventDefault() example,
2
3function clickHandler(event){
4 alert("Hey you clicked the submit button");
5 event.preventDefault();
6}
7
8//this will prevent the page from getting automatically refreshed after
9//the submit button is hit.