Note that you will probably want to use the innerHTML DOM element and not
the value element. Use value only for form fields.
If you are trying to get the value from within a div tag like this:
<div id="myDiv">My text</div>

then use this:

var myDiv = document.getElementById('myDiv').innerHTML;

Todd Allen
Estes Express Lines

"Hockchai Lim"
<lim.hock-chai@us> To
Sent by: web400@xxxxxxxxxxxx
web400-bounces@mi cc
[WEB400] javascript - use
2011-06-09 14:34 getElementById to get element
within a div

Please respond to
Web Enabling the
AS400 / iSeries

Do anyone know how I can use js to get DOM element within a <div>. I tried

below but it does not work:

var myDiv = document.getElementById('myDiv');

For 80 Years — Delivering Solutions that Exceed Expectations.
This communication and any transmitted documents are intended to be confidential. If there is a problem with this transmission, please contact the sender. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].