Last active
August 24, 2016 14:57
-
-
Save skarra/e3d7baed09ee9acad7cbd99cc240721b to your computer and use it in GitHub Desktop.
Common jQuery patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retrieve a data field from a specific DOM element. | |
// <label id="userid_1" data-userid="[email protected]"> Selected email: </label> | |
$("#userid_1").data('userid'); | |
// Use of localStorage key-value pairs | |
localStorage.setItem("gh_user", $("#gh_user_index").val()); | |
localStorage.getItem("gh_user"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment