从chrome中的标签获取文本框值 [英] Getting textbox value from label in chrome

查看:331
本文介绍了从chrome中的标签获取文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Chrome中,我正在使用标签值并分配给某个变量



  var  other = ' '; 
other = document.getElementById( <%= lblother.ClientID%> )。 value ;





之后我将此变量值赋予文本框



 $(' #<%= txtother.ClientID%>')。val(其他); 







但我得到的价值是'未定义'





如何获得准确值?

解决方案

' #<%= txtother.ClientID%>')。val(其他);







但我得到的价值是'未定义'





如何获得准确值?


试试这个:



  var 其他= ' '; 

// 获取标签值
other =

' #<%= lblother.ClientID%>' )。html的();

// 设置文本框值


In Chrome I am taking label value and assigning to some variable

var other='';
other= document.getElementById("<%=lblother.ClientID %>").value;



after that i am assing this variable value to text box

$('#<%=txtother.ClientID %>').val(other);




But I am getting txtother value as 'undefined'


How to get exact value?

解决方案

('#<%=txtother.ClientID %>').val(other);




But I am getting txtother value as 'undefined'


How to get exact value?


Try this:

var other = '';

// Get label value
other =


('#<%=lblother.ClientID%>').html(); // Set the textbox value


这篇关于从chrome中的标签获取文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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