Quote with Twitter Demo
Posted on May 14, 2018 in JavaScript, jQuery, WordPress by Matt Jennings
This is an example quote!
This is an example quote!
See the JSFiddle for this code including the jQuery, CSS, and HTML.
input placeholder
Attribute in Internet Explorer 9 Using Plain JS and jQuery
this
Some of the code snippets below are from my deck of cards JavaScript game that uses object constructors,
Read more…
Example code below of what .submit(), return false, and .serialize() in jQuery do when used with forms:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | <!DOCTYPE html> <html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script type="text/javascript"> $(function(){ // Definition of .submit(): // .submit() binds an event handler to the // "submit" JavaScript event, or triggers // that event on an element. // .submit() handler gets attached to a form $("form").submit(function() { // Definition of .serialize(): // Encode a set of form elements as a string for submission. // Example output for a FORM submission // using .serialize(): // first_name=Jane&last_name=Doe&email=jane%40example.com console.log($(this).serialize()); // return false; below stops page from // executing post.php and refreshing return false; }); // Triggers a submit event on the form when I // click the element with a .btn class $(".btn").click(function() { $("form").submit(); }); }); </script> </head> <body> <form action="post.php" method="post"> First Name <input name="first_name" type="text" /><br /><br /> Last Name <input name="last_name" type="text" /><br /><br /> Email <input name="email" type="text" /><br /><br /> <input value="submit!" type="submit" /> </form> <button class="btn">Click me to use .submit() differently!</button> </body> </html> |