English 中文(简体)
如何使用jquery或javascript去除指数上的一行? [复制]
原标题:How to use jquery or javascript to remove a row at index? [duplicate]
This question already has answers here:
Closed 12 years ago.

Possible Duplicate:
What is the best way to remove a table row with jQuery?

如果我用“<代码>tr标签”向3行投,那么我如何用jquery或其他一些javascript删除第1行(指数0)?

问题回答

try

$("tr").eq(0).remove();

然而,正如“Gregg”所说,对

这将把第3行删除。

$("table tr:eq(2)").remove();

另外,不忘记使用<代码><thead>和<terson>载于<table>。 如果你想用pl子 sort平路,则使事情更容易获得和帮助。

这里采用“一些其他javascript”办法,这种办法本身非常简单:

document.getElementById("myTable").deleteRow(0);

http://api.jquery.com/“rel=“nofollow” 彩虹/阿>是此类事物的巨大资源......

$("tr:first").remove()




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签