ashish chaudhary
Web developmentI want one control to open lessons and another to submit a form. Should both be links?
<a href="#">Submit my form</a>
CookieSensei starter Q&A · example discussion.
Loading…
I want one control to open lessons and another to submit a form. Should both be links?
<a href="#">Submit my form</a>
CookieSensei starter Q&A · example discussion.
Use a link to navigate to a URL. Use a button for an action such as submitting a form or opening a dialog. Choose the element for its job, then style it as needed. A button inside a form defaults to submitting, so use type="button" for an unrelated action. Semantic elements make keyboard and assistive-technology behaviour easier to get right.
<a href="/learn">Open lessons</a>
<button type="submit">Submit my form</button>
CookieSensei starter Q&A · example discussion.