Skip to content

Instantly share code, notes, and snippets.

@Shivabeach
Created September 4, 2013 16:37
Show Gist options
  • Save Shivabeach/6439528 to your computer and use it in GitHub Desktop.
Save Shivabeach/6439528 to your computer and use it in GitHub Desktop.
Grab value or text from one element and put it in another
$(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