Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Referring to DIV inside document using client-side VBScript

Posted on 2004-08-30
Medium Priority
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?


Question by:JXCovert
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 33

Accepted Solution

knightEknight earned 750 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

Expert Comment

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


Otherwise, it looks good to me.

LVL 53

Expert Comment

ID: 12207135

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.


Author Comment

ID: 12210420

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.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

715 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