Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery-1.4.1.min.js中的文本框未添加Jquery-value属性_Jquery - Fatal编程技术网

Jquery-1.4.1.min.js中的文本框未添加Jquery-value属性

Jquery-1.4.1.min.js中的文本框未添加Jquery-value属性,jquery,Jquery,我有一个用于显示用户列表的html表。当我单击一个tr行时,它会找到另一个html表中的td值到文本框 假设下面给出的html表是用户列表表 <table id="tbl1" border="1"> <tr> <td>name</td> </tr> <tr id="tr1" style='cursor:pointer;'> <td>Mani</td>

我有一个用于显示用户列表的html表。当我单击一个tr行时,它会找到另一个html表中的td值到文本框

假设下面给出的html表是用户列表表

<table id="tbl1" border="1">
   <tr>
       <td>name</td>
   </tr>
   <tr id="tr1" style='cursor:pointer;'>
       <td>Mani</td>
   </tr>
</table>
它正在工作,但文本框值为空,如何从html表中获取动态文本框值

而不是

$("#txt1").val($(this).find('td').text());
文本框中添加值

<input id="txt1" type="text" value="Mani">

更新:

而不是

$("#txt1").val($(this).find('td').text());
文本框中添加值

<input id="txt1" type="text" value="Mani">


更新:

它在你的小提琴上工作。它不工作了。。单击
tr
行后,当我单击重置按钮时,文本值为空…它在您的小提琴中工作。它不工作。。单击
tr
行后,当我单击重置按钮时,文本值为空…感谢您的快速响应。。!它在JSFIDLE中运行良好,但在我的表单中它不起作用。。当我添加
$(“#txt1”).attr('value',“rrrrrrr”)
表示文本框中显示了
rrrrrrr
的值,但没有将value属性添加到该文本框中…@manikandenseturaju,Welcome and no,它表示文本框value attr中也添加了value attr。如果我添加了like
$(“#txt1”).attr('val',“rrrrrrr”)
表示
val
的属性正在添加到该文本框中-(我通过firebug对此进行了检查),但是当我使用
value
时,它没有添加到该文本框中。.使用它可以得到
。嗨,我使用的是
jquery-1.4.1.min.js
。。在我的表单中-如果我添加其他属性,如
$(“#txt1”).attr('maxlength','20')表示它正在工作。。。但是当我添加
value
属性时,它并没有添加,而是正确地显示了值……感谢您的快速响应。。!它在JSFIDLE中运行良好,但在我的表单中它不起作用。。当我添加
$(“#txt1”).attr('value',“rrrrrrr”)
表示文本框中显示了
rrrrrrr
的值,但没有将value属性添加到该文本框中…@manikandenseturaju,Welcome and no,它表示文本框value attr中也添加了value attr。如果我添加了like
$(“#txt1”).attr('val',“rrrrrrr”)
表示
val
的属性正在添加到该文本框中-(我通过firebug对此进行了检查),但是当我使用
value
时,它没有添加到该文本框中。.使用它可以得到
。嗨,我使用的是
jquery-1.4.1.min.js
。。在我的表单中-如果我添加其他属性,如
$(“#txt1”).attr('maxlength','20')表示它正在工作。。。但是当我添加
value
属性时,它不是添加,而是正确地显示值。。。。
<input id="txt1" type="text" value="Mani">