一、jquery 属性操作
1、增加和删除属性
$("#id").attr("data-index",4),$("#id").removeAttr("data-index");自定义属性,建议使用attr
$("#checkbox").prop("checked",false), $("#checkbox").removeProp("checked"),固有属性,建议使用prop
一、jquery 属性操作
1、增加和删除属性
$("#id").attr("data-index",4),$("#id").removeAttr("data-index");自定义属性,建议使用attr
$("#checkbox").prop("checked",false), $("#checkbox").removeProp("checked"),固有属性,建议使用prop