我想在 HTML 正文中添加元素,但我遇到了问题。onclick 功能不起作用,因为我在该功能中吹错了。以下是我的html中的附加代码
var html= "<button class='btn fab-success' type='button' onclick='openTabGeneral('tab_map', 'Web GIS', 'client/map/index.html', 'Get', 'yes')'>Click</button>";
$("body").append(html);
该html代码的结果是
onclick="openTabGeneral(" 'tab_map'',''webgis'',''client/map/client="" map="" index.html'',''get'',''yes'')'=""
我想要这样的结果
onclick="openTabGeneral('tab_map', 'webgis', 'client/map/index.html', 'get', 'yes')"
请告诉我如何更改这样的代码^