javascript - prepend title tag to dom with jquery -
i prepend title of hyperlink dom-element, not show there
html
<ul class="grid effect-4" id="filter"> <li><a href="#" title="klimaat" data-group="red"><img src="klimaat.png" /></a></li> </ul> <p class="float-left">filter:</p>
javascript
$("ul#filter li a").on("click", function(){ var title = $(this).attr('title'); $(".float-left").prepend(title); }, function() { // out code });
you should use:
var title = $(this).attr('title'); $(".float-left").text("filter:"+title);
javascript jquery
No comments:
Post a Comment