Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AJAX Basics (retiring) AJAX and APIs Stage 4 Challenge

Why does Dave use the .prop() method for $searchField and the .attr() method for $submitButton?

Dave uses two different methods to set the "disabled" prop/attr to the boolean value of true. Is there a particular reason for this. I did some research (http://lucybain.com/blog/2014/attribute-vs-property/) and got a very good explanation for the difference between the two, but I don't know why he chose to use different methods. I tried the .prop() method in place of the .attr() method to set 'disabled' to true on $submitButton and got the same result.

2 Answers

There's some good information about the prop vs. attr here:

http://stackoverflow.com/questions/5874652/prop-vs-attr

I understand the the difference between an attribute and a property, but it's still unclear in this particular instance as to why Dave choses to use the .attr() method.