0

I tried to add text after the first children, without success

<a href="#" name="usernameMenu" class="dropdown-toggle" data-toggle="dropdown" role="button">
    <span class="glyphicon glyphicon-user"></span>add text here
    <span class="caret"></span>
</a>

I tried some command.

My last one

$('a[name="usernameMenu"] span:eq(0)').after().append("add text here");

I get

<a href="#" name="usernameMenu" class="dropdown-toggle" data-toggle="dropdown" role="button">
    <span class="glyphicon glyphicon-user">add text here</span>
    <span class="caret"></span>
</a>

1 Answer 1

1

Just remove .append

Try like this

$('a[name="usernameMenu"] span:eq(0)').after("add text here");

JSFIDDLE

Sign up to request clarification or add additional context in comments.

2 Comments

that work. if want to remove the same text, what command need to be used?
You wanna to remove add text here ? @roberttrudel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.