Angga Rifandi
Angga Rifandi

Reputation: 143

CSS Button Problem with Enter Key

I made login page with CSS submit button, the problem is I have to click the button (using mouse) and can't use enter key to process my page.

This is my code:

<a onClick="document.getElementById('form').submit();"><div id="loginButton" type="submit">LOGIN</div></a>

Upvotes: 2

Views: 559

Answers (1)

alex
alex

Reputation: 490233

Use a normal submit or button[type="submit"].

The latter you can style to look like anything.

Then you don't need to use JavaScript at all.

Upvotes: 3

Related Questions