<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<dl id="dl"></dl>
<ul id="ul">
<li data-id="1"><a href="">测试1</a></li>
<li data-id="2"><a href="">测试2</a></li>
<li data-id="3"><a href="">测试3</a></li>
<li data-id="4"><a href="">测试4</a></li>
</ul>
<button id="btn">转换</button>
<script type="text/javascript">
$(document).on('click', '#btn', function (e) {
$('#dl').append($('#ul').find('li'))
})
</script>
</body>
</html>
现在实现的效果是ul里面的内容转入到dl当前,但是我想同时将li标签变成dd
类似
<dl id="dl">
<dd data-id="1"><a href="">测试1</a></dd>
<dd data-id="2"><a href="">测试2</a></dd>
<dd data-id="3"><a href="">测试3</a></dd>
<dd data-id="4"><a href="">测试4</a></dd>
</dl>