$(this).val()与this.value

作用:都是获得当前Dom对象的value值(一般是表单元素)  text radio checkbox select

  基本没有什么区别,只是:

  this.value是js的原生语法,使用this.value无需引入任何库文件

  $(this).val()是jquery的语法,而$(this).val()则需要引入jquery库文件

相关文章:

  • 2022-12-23
  • 2021-09-22
  • 2021-12-07
  • 2022-02-07
  • 2021-09-15
  • 2022-12-23
  • 2021-09-20
猜你喜欢
  • 2021-07-17
  • 2022-02-02
  • 2021-10-29
  • 2021-06-21
  • 2021-12-27
  • 2022-12-23
  • 2022-02-16
相关资源
相似解决方案