Skip to content

Instantly share code, notes, and snippets.

@Fauntleroy
Created April 24, 2013 01:16
Show Gist options
  • Save Fauntleroy/5448840 to your computer and use it in GitHub Desktop.
Save Fauntleroy/5448840 to your computer and use it in GitHub Desktop.
A terse gist
<form id="placeholder_test">
<input name="test" type="text" placeholder="Placeholder Text" />
<button type="submit">Submit</button>
</form>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-placeholder/2.0.7/jquery.placeholder.min.js"></script>
/* See if fake placeholders 'stick' in some browsers */
$(function(){
$('input').placeholder();
$('#placeholder_test').on( 'submit', function( e ){
e.preventDefault();
alert( $(this).serialize() );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment