Reputation: 3289
I have a drop down list consisting several item.
Now hat i want is when we click And a drop down appears. Now when we click on any option in dropdown, the original should get replaced by clicked.
For eg : Original is And
, now in drop down if we click Not And
, then And
should get replaced by Not And
and so on.
Can someone please me out with it.
Thanks
Upvotes: 1
Views: 67
Reputation: 38112
You can use .html() to get and set the html content of an element:
$('.clicker li').click(function (e) {
$('.clicker .hello').html($(this).html())
});
Upvotes: 1
Reputation: 388406
Try
$('.click-nav .js ul li').click(function (e) {
$(this).parent().prev().html($(this).html())
})
Demo: Fiddle
Upvotes: 4