1.

How do you get the attribute of an HTML tag in jQuery?

Answer»

Developers can use this.title function INSIDE the function to get the ATTRIBUTE of an HTML tag in jQuery. Use the following script:

Example

$('a').CLICK(function() {
    var myTitle = $(this).attr ( "title" ); // from jQuery object
    //var myTitle = this.title; //javascript object
    ALERT(myTitle);
});

 



Discussion

No Comment Found