Jquery prop vs attr disabled dating

Jquery prop vs attr disabled dating

Jquery prop vs attr disabled dating 1

jquery is a changing library and sometimes they make regular improvements attr is used to get attributes from the html tags and while it is perfectly functional prop was added later to be more semantic and it works better with valueless attributes like checked and selected.

Jquery prop vs attr disabled dating 2

The prop method should be used to set disabled and checked instead of the attr method the val method should be used for getting and setting value but regarding to performance prop seems to be better than val setting values.

Jquery prop vs attr disabled dating 3

If i have a button that i am enabling and disabling depending on user selection what is the best way to disable it it want to choose the way that is.

Jquery prop vs attr disabled dating 4

Since jquery 161 attr returnschanges property like before 16 thus your tests do not make much sense be aware of minor changes in return values eg jquery attr vs prop there are a list of props 1 check box with jquery 1 find the id by class in nested div jquery.