jQuery获取选中内容及设置元素属性的方法


获取选中select :

$("#id option:selected").val();

自定义radio:

$("input[name=sex][value="+data.sex+"]").attr("checked",true);

获取radio:

$("input[name='sex']:checked").val()

设置input不能编辑:

$("#cashNum").attr("disabled","disabled");


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3