Set attributes of the element


The .attr(attributeName, value) method sets the attribute value for element.

Hello World


var link = $('a').attr('title','Hello World');


With the above example you will get the href of the anchor tag.

Advertisements

One thought on “Set attributes of the element

  1. hello!,I like your writing very so much! percentage we keep up a correspondence extra approximately your article on AOL? I require an expert in this house to resolve my problem. May be that is you! Taking a look forward to see you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s