Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140817

how to add a single quote string in the jquery append function?

$
0
0

I want to add elements to the HTML body, but I have a problem. the onclick function doesn't work because I blew the wrong one in the function. the following is the append code in my 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);

the result of that html code is

onclick="openTabGeneral("'tab_map'',''webgis'',''client/map/client="" map="" index.html'',''get'',''yes'')'=""

i want the result like this

onclick="openTabGeneral('tab_map', 'webgis', 'client/map/index.html', 'get', 'yes')"

please tell me how to change the code like this ^


Viewing all articles
Browse latest Browse all 140817

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>