btn=$(".bx-composite-btn")//выбрал кнопку $(".footer li:last-child").after('<li>'+btn+'</li>')//вставил кнопку //получил <li>1</li> <li>2</li> <li>[object Object]</li>//получаю <li><a class="bx-composite-btn">текст</a></li>//а должно быть
1 answer
This is all because btn
is an object, not a string, and when casting to a string, you get "[object Object]"
To solve, you can use the possibility of creating objects, rather than collecting the string, for this you need to change the insertion code
btn=$(".bx-composite-btn")//выбрал кнопку $(".footer li:last-child").after($('<li>').append(btn))//вставил кнопку
In this case, the button will be transferred to the last li
|
btn
is an object, not a string, and when casting to a string,"[object Object]"
is obtained - Grundy