jQuery-attr()和prop()

    xiaoxiao2021-03-25  30

    attr()函数返回值为string。使用getAttribute()方法实现的。

    prop()函数返回值为anything。尤其是适用在应该为boolean类型值的属性上。

    For example, selectedIndextagNamenodeNamenodeTypeownerDocumentdefaultChecked, and defaultSelected should be retrieved and set with the .prop() method.以上属性值应该使用prop()方法。

    转载请注明原文地址: https://ju.6miu.com/read-26659.html

    最新回复(0)