2
We can assign a title (attribute title
), to an element marked in HTML, which has this class, thus:
$(".title-texto").attr("title", $(".title-texto").text());
Example of HTML markup with only one element with class:
{<ul class="miniaturas">
<li>
<a href="link1.html">
<img src="img/imagem1.png" >
<p class="title-texto" >texto 1 escrito no html, com o title atribuido no Jquey</p>
</a>
</li>
</ul>}
How could I assign title
different from the elements <p>
who has the same class?
<ul class="miniaturas">
<li>
<a href="link1.html">
<img src="img/imagem1.png">
<p class="title-texto" >texto 1 escrito no html, com o title atribuido no Jquey</p>
</a>
</li>
<li>
<a href="link2.html">
<img src="img/imagem2.png">
<p class="title-texto" >texto 2 escrito no html, com o title atribuido no Jquey</p>
</a>
</li>
<li>
<a href="link3.html">
<img src="img/imagem3.jpg">
<p class="title-texto" >texto 3 escrito no html, com o title atribuido no Jquey</p>
</a>
</li>
</ul>
I have improved the formatting of the question, something that has gone wrong, please correct or warn me.
– Zuul
All right, it got better; I’m learning from the masters. ;) vlw!
– Thiago Jem