如何在javascript数组中编写html的锚元素?

如何在javascript数组中编写html的锚元素?,javascript,arrays,anchor,Javascript,Arrays,Anchor,我必须制作一个Javascript数组,其中一个元素是: 删除 问题是如何用引号括起来?我已经在其中使用了单引号和双引号 现在,阵列线如下所示: ['39','190507hdyq9o','<a href="http://localhost/cmhs_app/index.php/patient/view/39">DEBI PRASAD CHATTERJEE</a>','66','8670079226',' '<a class="btn-sm btn-danger"

我必须制作一个Javascript数组,其中一个元素是:

删除

问题是如何用引号括起来?我已经在其中使用了单引号和双引号

现在,阵列线如下所示:

['39','190507hdyq9o','<a href="http://localhost/cmhs_app/index.php/patient/view/39">DEBI PRASAD CHATTERJEE</a>','66','8670079226',' '<a class="btn-sm btn-danger" href="http://localhost/cmhs_app/index.php/patient/delete/39" onclick="return confirm(\'Do you really want to delete this Patient?\')">Delete</a>'],
这不起作用。

这应该起作用:

var arr = ['<a class="btn-sm btn-danger" href="http://localhost/xyz/index.php/item/delete/39" onclick="return confirm(\'Do you really want to delete this Patient?\')">Delete</a>'];

console.log(arr[0]);

这成功了!谢谢我的数组在元素之前有一个额外的'。