Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 351 Bytes

File metadata and controls

10 lines (7 loc) · 351 Bytes

Section 4.3: Setting value of HTML attribute

If you want to add an attribute to some element you can use the attr(attributeName, attributeValue) function.

Example:

$('a').attr('title', 'Click me');

This example will add mouseover text "Click me" to all links on the page. The same function is used to change attributes' values.