javascript中函数字符参数传值报错

<button class="btn btn-dangerous btn-mini" type="button" onclick="deleteById(${stu.id })">删除</button>

${stu.id }值为JS123,但浏览器提示ReferenceError: JS123 is not defined  ,当把函数体内加上‘ ’ 两个单引号即可!

javascript中函数字符参数传值需要加单引号


相关文章:

  • 2021-12-05
  • 2021-07-22
  • 2022-01-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-26
相关资源
相似解决方案