帮我做这个脚本 [英] Help me to do this script

查看:63
本文介绍了帮我做这个脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

i想得到这个id的价值...



Hi all
i want to get the value of this id...

var val='categoryName_'+value2;

  var value1=document.getElementById('categoryName_'+value2).value;

推荐答案

它给出了结果

it gives result
var val='categoryName_'+value2;

  var value1=document.getElementById('categoryName_'+value2).value;



请给出什么是你的错误或问题.....


please give what is your error or problem.....


最好使用pass temp变量来获取值。





var val =''categoryName_''+ value2;



var value1 = document.getElementById(val);



//如果它只是ID这是有效的

alert(value1.innerHtml) ;



但是,无法获取服务器端控件的值,因为在字符串连接期间它不允许使用(.clientID)。
better you use pass temp variable To get the value.


var val=''categoryName_'' + value2;

var value1=document.getElementById(val);

//if it is just ID this works
alert(value1.innerHtml);

But, cant get the value of the server side controls because it wont allow the usage of (.clientID) , during string concatenation.


它应该工作......你面临什么错误或问题?请详细说明您的情况
It should work ... What error or issue you are facing ? Elaborate your situation please


这篇关于帮我做这个脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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