Skip to content

Instantly share code, notes, and snippets.

@Holek
Created September 28, 2012 12:17
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 Holek/3799486 to your computer and use it in GitHub Desktop.
Save Holek/3799486 to your computer and use it in GitHub Desktop.
Label-trigerred submit
/**
* Label-trigerred submit
*/
label {
cursor: pointer;
color: blue;
border: 1px solid #CCC;
padding: 3px 6px;
}
button {
margin: 10px 0;
color: #CCC;
}
<label for="button">Click me</label>
<form method="get" action="/">
<button type="submit" id="button" name="button" value="Button">Don't click me</button>
</form>
<p>A click on a label above will put a Dabblet in a Dabblet.</p>
<img src="http://memecaptain.com/xzibit.jpg" src="YO DAWG" height="81" width="125" />
<h2>Problems</h2>
<ul>
<li>Clicking on a label in Mobile Safari does not work.</li>
<li>Clicking on a label in Internet Explorer 8 (strangely all other versions seem to work) does not work.</li>
</ul>
{"view":"split","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment