1. 程式人生 > >jQuery獲取屬性

jQuery獲取屬性

html prop pre class 對象 jquer light 常用 jquery對象

jQuery在獲取jQuery對象的屬性時,出現attr()獲取不到的情況,此時,請使用prop()獲取

如下為經常用到的:

var oHtml=$(this).prop("outerHTML");

$(this).prop("checked", "checked");

  

jQuery獲取屬性