JQuery Programmer Question: Download JQuery Programmer PDF

How to set attributes of an element using jQuery?

Tweet Share WhatsApp

Answer:

The attr(name, value) method can be used to set the named attribute onto all elements in the wrapped set using the passed value.

Download JQuery Programmer PDF Read All 201 JQuery Programmer Questions
Previous QuestionNext Question
What is the advantage of using protocol less URL while referencing jQuery from CDNs?Is there any difference between body onload() and document.ready() function?