Difference Between Prop and Attr in jQuery?



Difference Between Prop and Attr in jQuery?..

Answer / Sulabh Dhawan

Prop refers to properties of HTML elements, which are accessed using camelCase syntax (e.g., $(selector)[propertyName]). On the other hand, Attr refers to attributes of HTML elements, which are accessed using attribute names with hyphens (e.g., $(selector).attr('attribute-name')).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

What is the difference between event.PreventDefault and event.stopPropagation?

1 Answers  


How to multiple version of jQuery?

1 Answers  


How to delete cookies in jquery?

1 Answers  


What is jquery a client or server scripting?

1 Answers  


Explain the concepts of "$ function" in jquery with an example?

1 Answers  


List a few features of jquery mobile? : jQuery Mobile

1 Answers  


Why there are two different version of jQuery library?

1 Answers  


Define bind() and unbind elements in jQuery?

1 Answers  


Explain the term method chaining? : jQuery Mobile

1 Answers  


What is the difference between onload() and document.ready() function used in jquery?

1 Answers  


How to include jQuery in ASP.Net project?

1 Answers  


How to work with jQuery parent(), children() and siblings()?

1 Answers  


Categories