Reputation: 63
I want to insert some text after the text in the span as follows. I want add the × after Tag1 like "Tag 1 ×". But it the × is after the </span>
, which means outside the span. Thanks.
BTY, is there any good suggestion for the delete button for the tags?
html:
<li><span>Tag 1</span></li>
jquery:
$('li span').append('<p>×</p>');
Upvotes: 1
Views: 4834
Reputation: 18462
var span = $('li span');
span.html(span.html() + '×');
Is this what you're looking for?
If you want to do it in one line:
$(that).find('span')[0].innerHTML += '×';
Upvotes: 5