什么时候应该在aspn.net中使用document.getElementById [英] when should use of document.getElementById in aspn.net

查看:42
本文介绍了什么时候应该在aspn.net中使用document.getElementById的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

我们应该使用document.getElementById

用于asp.net控件还是html控件? (或者他们两个以及为什么?)

感谢任何答案

hi to all
when we should be use of document.getElementById
for asp.net control or html control? (or both of them and why?)
thanks for any answer

推荐答案



参考有关此功能的msdn文章。

getElementById方法 [ ^ ]

HtmlDocument.GetElementById方法 [ ^ ]



希望它有所帮助。
Hi,
refer the msdn article regarding this function.
getElementById method[^]
HtmlDocument.GetElementById Method [^]

hope it helps.


你应该阅读文档对象模型(DOM)级别3核心规范 [ ^ ] 。

请参考以下链接:

You should read the Document Object Model (DOM) Level 3 Core Specification[^].
Refer the links below:
  • document.getElementById[^]
  • javascript document.getelementbyid[^]
  • getElementById method[^]


朋友,



document.getElementById(''aspControl或htmlcontrol'')。值



这里我们得到了价值该控件

我们用于验证的大部分时间意味着表单验证



document.form1.getElementById(''aspControl或htmlcontrol '')。value

我们也可以这样找到我们正在使用的控件的值(文本)...



文件.getElementById --for id

document.getElementByName ---名称

document.getElementByTag ... etc



我们在javascript库中喜欢这个方法
hi pal ,

document.getElementById(''aspControl or htmlcontrol'').value

Here we getting the value of that control
most of the time we are using for validations means form validations

document.form1.getElementById(''aspControl or htmlcontrol'').value
we can like this also for finding value(text) of a control we are using...

document.getElementById --for id
document.getElementByName ---for name
document.getElementByTag ...etc

we have like this methods in javascript library


这篇关于什么时候应该在aspn.net中使用document.getElementById的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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