<form> <label>Password: <input name="password" type="password" onChange="onChange()" /> </label><br /> <label>Confirm : <input name="confirm" type="password" onChange="onChange()" /> </label><br /> <input type="submit" /> </form>