Skip to content

Instantly share code, notes, and snippets.

@seka
Created August 27, 2015 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seka/0fc91866a4a602db8ff4 to your computer and use it in GitHub Desktop.
Save seka/0fc91866a4a602db8ff4 to your computer and use it in GitHub Desktop.
An invalid form control with name='' is not focusable.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>sample html</title>
</head>
<body>
<form id="hoge">
<fieldset>
<legend>test form</legend>
<input required>
</fieldset>
<button type="submit">submit</button>
</form>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
(function() {
$('#hoge').submit(function(e) {
e.preventdefault();
});
})();
</script>
</body>
</html>
@seka
Copy link
Author

seka commented Aug 27, 2015

err: An invalid form control with name='' is not focusable.
Why this happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment