html代码 <button onclick="javascript:copy(this);" id="{$rel['id']}">编辑</button> js 代码 需要手动引入layui js css 包 这里我就不示范了 function copy(e){ var id=e.id