Solved

Referring to DIV inside document using client-side VBScript

Posted on 2004-08-30
4
441 Views
Last Modified: 2012-08-13
Can I refer to a DIV inside an HTML document using client side VBScript inside IE (intranet)?

I have tried it all but it seems that while a <FORM....> becomes a child of its HTML document contained, a DIV does not?

Confused.

John
0
Comment
Question by:JXCovert
4 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 250 total points
ID: 11933394
show us your code ...

I would think that you could do this:

<DIV id="myDiv">content</DIV>

and in your code:

div = document.getElementById("myDiv")
msgbox div.innerHTML
0
 
LVL 1

Expert Comment

by:MMabatig
ID: 12205752
Not sure if "document.getElementById('myDiv');" will work in IE knightEknight.  I believe that  JXCovert may want to use:

document.all('myDiv');

Otherwise, it looks good to me.

-Mark
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12207135
MMabatig

The obsolete document.all has not been required since IE4 which does not even have a measuable market share anymore.  While a lot of developers continue to spew out defective pages using document.all there is absolutely zero to be gained by using it for anything other then in references to legacy relics in a museum somewhere.

Cd&
0
 

Author Comment

by:JXCovert
ID: 12210420
Heh

I found that a DIV is NOT a child to the document.  Referring to myDiv as document.myDiv.disabled threw an error.  Referring to myDiv.disabled worked well.

Strange.  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now