The main reason I did that was as a temporary placeholder. Using alert as error handling is not really correct. The correct method would be to manipulate the html so that it highlights that the username/password was incorrect. Typically websites will place red text either underneath or to the side of the text box which caused the issue.