Jquery, set value of td in a table?

后端 未结 5 1118
予麋鹿
予麋鹿 2021-02-02 05:52

I create dynamic a table with and tags. One of the td tags gets the id \"detailInfo\". I have an onclick function on some button.

5条回答
  •  面向向阳花
    2021-02-02 06:08

    From:

    • Manipulation | jQuery API Documentation

    it could be:

    .html()

    In an HTML document, .html() can be used to get the contents of any element.

    .text()

    Unlike the .html() method, .text() can be used in both XML and HTML documents. The result of the .text() method is a string containing the combined text of all matched elements.

    .val()

    The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

提交回复
热议问题