Solved

Referring to DIV inside document using client-side VBScript

Posted on 2004-08-30
4
445 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP sending two datas 2 30
Popup write two lines 3 32
Scroll 5 news at a time using vticker 2 41
My tooltip is not displaying correct 11 20
This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

752 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