Webby
Webby

Reputation: 2765

li rel= selector

Please help selecting rel="28700" to change the <li> text:

<li id="pen_li_8" rel="28700"><span class="linkselectValue">Text to be changed</span></li>

I've tried the obvious:

$("li[rel='28700']").text('new text');

to no avail. Any ideas?

P.S. Sadly, selecting the ID or class, or editing the HTML, is not an option.

Upvotes: 1

Views: 1160

Answers (1)

Ry-
Ry-

Reputation: 224904

Your syntax is invalid, for one thing - you're missing a closing ]. Also, if you want to change the text in the <span>, you need to select that, too. Here's the selector you want:

$('li[rel=28700] span').text('new text');

Upvotes: 3

Related Questions