1$( some_item ).attr( "id", "some-id" );
2// for setting multiple attributes, it's similar to the css() property. However, quotes are not always required for attr()
3$( some_item ).attr({
4 id: "some-id",
5 // or others.
6 title: "Opens in a new window",
7 // attributes which contain dash(-), should be covered in quotes.
8 "data-value": "internal link"
9});