【发布时间】:2022-01-18 00:37:59
【问题描述】:
我需要使用 Jquery 在元素 'a' 中的文本之前更改 'span' 对象的顺序。
有人可以帮助我吗?
<a href="#" class="has-submenu">
Some text content
<span class="dropdown-menu-toggle"></span>
<span class="sub-arrow"> > </span>
</a>
必须是:
<a href="#" class="has-submenu">
<span class="dropdown-menu-toggle"></span>
<span class="sub-arrow"> > </span>
Some text content <-(This text must to be in the end)
</a>
【问题讨论】:
-
你试过什么?为什么这必须在 jQuery 中完成,而不是仅仅移动 HTML?