Product Code

jQuery Event handling Forms JavaScript Selectors Public



The createProductCodeForm function is used to create a new form that accepts a product code from a user.

The current version of the form contains the hint: 'The product code can be found on the label'. This hint is currently always visible to the user.

Improve the form so that the hint is only rendered when the input element is the focused element.

ECMAScript 6, jQuery v3.2.1 (available as $)

  •   Hint is not visible: Wrong answer
  •   Focus shows hint: Wrong answer
  •   Unfocusing hides hint: Wrong answer