带有转义序列html的链接

link with escape-sequence html

本文关键字:链接 html 转义序列      更新时间:2023-09-26

我的escape链接有问题。。。

 var linkregion= '<a href='"http://www.example.com/Reg_'+numeroReg+''" target='"blank'">'+'Description of Reg: '+numeroReg+'</a>';
 document.getElementById('linkreg').innerHTML = linkregion;

 <span id="linkreg"></span>

numeroReg是一个数字

但当文档准备好时,在链接的第一个位置有:">查看图片:

http://i58.tinypic.com/2enm62f.png

我希望你能帮我吗:(

感谢

不能转义双引号,因为字符串位于单引号中。

 var linkregion = '<a href="http://www.example.com/Reg_' + numeroReg + '" target="blank">Description of Reg: ' + numeroReg + '</a>';