Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のように、スパン内のテキストの後にテキストを挿入したいと思います。「Tag 1 ×」のように Tag1 の後に × を追加したい。しかし、 × が の後にあり</span>、スパンの外側を意味します。ありがとう。
</span>
BTY、タグの削除ボタンについて何か良い提案はありますか?
html:
<li><span>Tag 1</span></li>
jquery:
$('li span').append('<p>×</p>');
var span = $('li span'); span.html(span.html() + '×');
これはあなたが探しているものですか?
1行で実行したい場合:
$(that).find('span')[0].innerHTML += '×';
$('li span').after('×');