Skip to content

Instantly share code, notes, and snippets.

@klandergren
Forked from gvinter/gist:1036932
Created June 21, 2011 00:27
Show Gist options
  • Select an option

  • Save klandergren/1036958 to your computer and use it in GitHub Desktop.

Select an option

Save klandergren/1036958 to your computer and use it in GitHub Desktop.
Javascript Form
<form>
Name: <input type="textbox" name="name" /> <br />
Check box if you're alive: <input type="checkbox" name="alive" /> <br />
<input type="button" name="submit" value="we win click!" onClick="pulse(form)" />
</form>
<script type="text/javascript">
function pulse(data){
console.log(data);
// uncomment below and fix
// var isAlive = data....
// var name = data....
/*
if (isAlive) {
alert("Thank goodness you're alive," + name);
}
else {
alert("Oh, no!" + name + "Don't die!");
}
*/
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment