JQuery gets methods for selecting content and setting element attributes

  • 2020-03-30 03:32:27
  • OfStack

Get selected select:


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

The custom radio:


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

For radio:


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

Setting input cannot be edited:


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


Related articles: