Created
December 13, 2012 21:37
-
-
Save jlittlejohn/4280183 to your computer and use it in GitHub Desktop.
JS: Retrieve Content Values
This file contains hidden or 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
$("p").click(function () { | |
var htmlstring = $(this).html(); // obtain html string from paragraph | |
$(this).text(htmlstring); // overwrite paragraph text with new string value | |
}); | |
var value1 = $('input#username').val(); // textfield input value | |
var value2 = $('input:checkbox:checked').val(); // get the value from a checked checkbox | |
var value3 = $('input:radio[name=bar]:checked').val(); // get the value from a set of radio buttons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment