当代码里有多个引号时怎么解决? 在"号或'前加\即可,如onmousedown="this.className = \'td nav_blueActive hand\'" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 几种正确的写法:onmousedown="this.className = \"td nav_blueActive hand\""onmousedown="this.className = 'td nav_blueActive hand'"onmousedown='this.className = "td nav_blueActive hand"'onmousedown='this.className = \'td nav_blueActive hand\'' fivetwogtt(快乐睫毛) 归纳的好。只要一层是“,里面一层是‘就好了。要么转义。 可以用"标记,也可以用\"...\",需要嵌套的时候可以\\\"...\\\",转义符可以一直嵌套下去:document.write("<span style=\"width:100;background-color:yellow\" onclick=alert("test") onmouseover='status=\"abcd\\\"defg\\\"hijk\"'>test</span><br>"); javascript怎么实现一个程序执行完成后用了多少时间啊? 换了IE9后, 函数调用 报错未定义 向左不间断滚动,如何设置默认不滚动 初学JS 做了个练习 请大家拍砖 如何用js判断text框里输入的是图片地址? $.get问题,高手请进 embed怎么对一个视频或音频播放的完成做出响应 请教,为什么我得不到input的value呢? 各位大侠,以下情况应该怎样做?? 请问大神这10行JS代码哪里错了? 如何强制输入数字???在线等。。。 相对路径的问题,问题比较长,不能在标题描述,麻烦进来看看
onmousedown="this.className = \"td nav_blueActive hand\""onmousedown="this.className = 'td nav_blueActive hand'"onmousedown='this.className = "td nav_blueActive hand"'onmousedown='this.className = \'td nav_blueActive hand\''
只要一层是“,里面一层是‘就好了。要么转义。
document.write("<span style=\"width:100;background-color:yellow\" onclick=alert("test") onmouseover='status=\"abcd\\\"defg\\\"hijk\"'>test</span><br>");