Controlling Output Text with JavaScript if else: an Example