在"号或'前加\即可,如
onmousedown="this.className = \'td nav_blueActive hand\'"

解决方案 »

  1.   

    几种正确的写法:
    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\''
      

  2.   

    fivetwogtt(快乐睫毛) 归纳的好。
    只要一层是“,里面一层是‘就好了。要么转义。
      

  3.   

    可以用"标记,也可以用\"...\",需要嵌套的时候可以\\\"...\\\",转义符可以一直嵌套下去:
    document.write("<span style=\"width:100;background-color:yellow\" onclick=alert(&quot;test&quot;) onmouseover='status=\"abcd\\\"defg\\\"hijk\"'>test</span><br>");