How does jquery remove the content from td
This article mainly explains "jquery how to remove the content in td", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "jquery how to remove the contents of td"!
jquery to remove the contents of td method: 1, use "$("td")" statement to obtain td object;2, use html() method to set the contents of td object to empty, and then remove the contents of td object, syntax "$("td").html("")".
This tutorial operates on Windows 7, jquery version 1.10.2, Dell G3 computers.
JQuery removes content from TD
In jquery, html() can be used to remove the contents of td.
The html() method returns or sets the contents of the selected element (inner HTML).
Just use the html() method to set the contents of the td element to null.
Implementation code:
$(document).ready(function() { $("button").click(function() { $("td").html(""); }); }); person information name age Peter 20 Lois 20 Click the button to remove the content from td
At this point, I believe that everyone has a deeper understanding of "how to remove the contents of td in jquery," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!