JavaScript can be added to input fields for validation. In this example, when you finish typing in a value to the input it will be validated.