Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set title property for span tag dynamically

Tags:

jquery

asp.net

I am not able to set the title property for span tag... I am using the following code

 $('.className').find("span").attr("title",'Some_text');

Its not working...

like image 888
Noono Avatar asked Nov 16 '12 17:11

Noono


1 Answers

Maybe the problem is that you are searching for a span element in a class, this will work for you.

$('span.className').attr('title','New Title');​

Here you apply the title to all the span elements with that class.

Hope it helps you.

Fiddle

like image 151
Eduardo Quintana Avatar answered Oct 21 '22 19:10

Eduardo Quintana