使用id获取控件值

var actCplQty = $("input[id*=actCplQty]").val();

$("#mobile_reg_form").html()

 

使用name获取控件值

var lineCode = $("*[name='lineCode']").val(); 

$("input[name*=lineCode]").val()

name是input标签的属性值,jQuery提供了attr() 方法用于设置/改变属性值

$("input:text").attr("name");
$("input:text").prop("name");  // 也可以使用prop()方法获取属性

$("*[name='name']").val(); //获取vlaue值
$("*[name='name']").attr('id','name'); //添加id名称
$("*[name='name']").after('<div>hello world</div>'); //在当前外添加元素 

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-04-13
  • 2021-10-26
  • 2022-12-23
相关资源
相似解决方案