how to display error message in javascript with alert