Cómo verificar la contraseña y volver a escribir contraseña en HTML

<label>password :
  <input name="password" id="password" type="password" onkeyup='check();' />
</label>
<br>
<label>confirm password:
  <input type="password" name="confirm_password" id="confirm_password"  onkeyup='check();' /> 
  <span id='message'></span>
</label>
 Run code snippet
Glamorous Goosander