我試圖在一個範圍中包裝每個數字。在一個範圍中包裝每個字符
這是我在哪裏。
<div class="numbers">12345</div>
<div class="numbers">12345</div>
<div class="numbers">12345</div>
$('.numbers').each(function (index) {
var characters = $(this).text().split("");
$(this).empty();
$.each(characters, function (i, el) {
$(this).append("<span>" + el + "</span");
});
});
我在哪裏可能會出現語法錯誤?
非常感謝。解釋確實有幫助 – uriah