单引號中有双引號。双引號还须要引號怎么办


    今天,我在做一个日历控件时,发如今拼接HTML中的input时,出现引號里还有引號:

    '<input type="button" onclick="findSearch("MU")"'/>


    结果,火狐浏览器出现“死机”现象。


    将findSearch中的双引號改为单引號,结果出现报错提示;


    后来将findSearch中的双引號利用转义字符。findSearch(\"MU\"),结果是点击事件失灵


    经过不断的查找资料。发现将findSearch中的双引號改为&quot;就正常了

    '<input type="button" onclick="findSearch(&quot;MU&quot;)"'/>

     

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-02-12
  • 2021-05-18
  • 2022-12-23
  • 2021-11-07
  • 2021-07-12
  • 2021-08-23
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-12-17
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案