Before typing in an input element, make sure it is focused.