The difference is that, the prop method deals with properties defined by the Dom ApI HTMLElement object, rather than attributes defined by the htmL element in markup.
Often, the attributes and properties are the same, but this isn’t always the case. A simple example is the class attribute, which is represented in the HTMLElement object using the className property.
In general, the prop method is the one you should use because it returns objects that are easier to work with than attribute values.
Programming is Easy !!!!