I'm basically trying to allow the user to click on a 'recent search tag' and add it to the search input in full. What I mean by 'in full' is the tags' styling along with text.
For example:
I know there's a jquery plugin for this. But I really wanted to know if there was a simple approach in getting this done.
I have a jsfiddle. Right now when I click on the recent search tag, it takes the text of each div and one at a time.
$('.tag').click(function(e){
var tag = $(this).children().html();
$('input').val(tag);
e.preventDefault();
});
Any help is greatly appreciated. Thanks!