Difference between prop() and attr()? : jQuery Mobile



Difference between prop() and attr()? : jQuery Mobile..

Answer / Amarjeet Singh

The main difference between .prop() and .attr() in jQuery is that .prop() deals with Boolean, enumerated, and non-HTML attributes, while .attr() handles all attributes. .prop() can also be used on non-selected elements, whereas .attr() returns undefined for non-selected elements.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Tell me how to select combobox select value and text using jquery?

1 Answers  


How can you use array with jquery?

1 Answers  


Can we include multiple version of jquery? : jquery mobile

1 Answers  


What is the difference between $.map and $.grep in jQuery?

1 Answers  


What are selectors in jquery?

1 Answers  


List the basic selectors in jquery?

1 Answers  


Why do we need to go for JQuery?

1 Answers  


Can you please explain the difference between event.preventdefault and "return false"? : jquery mobile

1 Answers  


What is each() function in jQuery? How do you use it?

1 Answers  


Explain the difference between body onload() and document.ready() function? : jquery mobile

1 Answers  


What are the types of selectors in jQuery?

1 Answers  


What is jQuery?

1 Answers  


Categories