如何使用jQuery将文本框附加到表行? [英] How to append a textbox to a table row with jQuery?

查看:86
本文介绍了如何使用jQuery将文本框附加到表行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jQuery将文本框附加到表行?

How to append a textbox to a table row with jQuery?

推荐答案

如何将输入类型附加到表行?您必须将其附加到表格单元格中,否则,可以将其绝对地放置在表格行的位置.您无法通过DOM将其附加到一行,

How can you append an input type to a table row? You have to append it to a table cell, if not you can position it absolute at the position of the table row. You can't append it to a row via the DOM,

看到另一个问题,为什么不将隐藏的输入类型添加到该行的第一个单元格?您可以轻松地这样做:

Seeing your other question, why don't you add an input type hidden to the first cell of the row? You could easily do this like this:

$('tr#id td:first').append($('<input type="hidden" id="hidden_field" name="hidden_field" value="your value" />'));

这篇关于如何使用jQuery将文本框附加到表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆