Created
September 4, 2013 16:37
-
-
Save Shivabeach/6439528 to your computer and use it in GitHub Desktop.
Grab value or text from one element and put it in another
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
$(function () { | |
$('li.inliner').on('click', function () { //click on the li | |
var content = $(this).text();//content is the text that you clicked on | |
//PLACE THE TEXT INSIDE THE INPUT FIELD, YOU CAN CHANGE YOUR SELECTOR TO TARGET THE RIGHT INPUT | |
$('input[name="art"]').val(content); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment