javascript – 从与jquery的链接更改html文本

一个简单的问题

有没有办法改变文字“点击这里”

<a id="a_tbnotesverbergen" href="#nothing">click here</a>

在这个链接

理查德

你必须使用jquery’s text() function.它做的是:

Get the combined text contents of all
matched elements.

The result is a
string that contains the combined text
contents of all matched elements. This
method works on both HTML and XML
documents. Cannot be used on input
elements. For input field text use the
07001.

例如:

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

06000

Test Paragraph.

Test Paragraph.

有了你的标记,你必须做:

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

并会导致

<a id="a_tbnotesverbergen" href="#nothing">new text</a>
http://stackoverflow.com/questions/901909/change-html-text-from-link-with-jquery

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:javascript – 从与jquery的链接更改html文本