Reputation: 70406
I select
$("a.tp[programm='" + programm + "']");
then I want to select its nested element span.thump and set the text of it. How do i realize that?
<h4><a programm="74" class="tp" href="#"><img src="/images/tuo.png"></a><a href="">
<img width="180" height="40" src="/images/kauf_default.png"><br>test
<span class="thump">1</span><img src="/images/ilike.png"></a></h4>
Upvotes: 0
Views: 2049
Reputation: 523214
Do you mean something like
<a class="tp" programm="foo">blah <span class="thump">setTextOfThis</span> blah</a>
? If so, try
$("a.tp[programm='" + programm + "'] span.thump").text(newText);
Edit: Regarding the update, try
$("a.tp[programm='" + programm + "'] + a span.thump").text(newText);
(You may want ... ~ a span.thump
if the <a>
containing that <span>
is not immediately next to that <a programm>
.
Upvotes: 3