English 中文(简体)
2. 与 Java本Script合
原标题:Get Element in div with JavaScript

我想说出一个与 Java成文相左/站。 由于 Java本被叫来,在作出闪电之后, but子在处决时就存在。

纽伦处于等级:

<html><body><form#form1><div#control><asp:Button#Export1>

我试图用几个小时时间提到该纽州,但似乎没有任何工作:

document.getElementById("Export1")
// and
document.getElementbyId("form1").getElementById("control").getElementById("Export1")
// and many more

如何提及该纽吨(为了修改btnref.disabled=真实)?

感谢你们的帮助!

最佳回答

您是否尝试在文件上进行正确分类,并选择“观点来源”,以了解该守则如何实际产生? 《<代码>asp:Button是服务器控制,在投稿时被翻译为投入领域。 在此期间,实地的身份证将不是你在座标上定的。

您可在服务器上使用<代码>Export1.ClientID,以获得控制。

问题回答

如果这是你四分五裂的唯一 but子的话,这应当做到:

var btnref = document.getElementById("controls").getElementsByTagName("button")[0];

通常情况下,顿语的<代码>id在页面来源中保持不变。 Click on view sources in the RUS and look for that tag to seek the new id. 那么,你就可以在以下一些方面利用这一id:

document.getElementbyId("Export1_some_unique_id")...




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签