change html text from link with jquery change html text from link with jquery javascript javascript

change html text from link with jquery


You have to use the jquery's text() function. What it does is:

Get the combined text contents of allmatched elements.

The result is astring that contains the combined textcontents of all matched elements. Thismethod works on both HTML and XMLdocuments. Cannot be used on inputelements. For input field text use theval attribute.

For example:

Find the text in the first paragraph(stripping out the html), then set thehtml of the last paragraph to show itis just text (the bold is gone).

var str = $("p:first").text();$("p:last").html(str);

Test Paragraph.

Test Paragraph.

With your markup you have to do:

$('a#a_tbnotesverbergen').text('new text');

and it will result in

<a id="a_tbnotesverbergen" href="#nothing">new text</a>


The method you are looking for is jQuery's .text() and you can used it in the following fashion:

$('#a_tbnotesverbergen').text('text here');


$('#a_tbnotesverbergen').text('My New Link Text');

OR

$('#a_tbnotesverbergen').html('My New Link Text or HTML');