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;
Estes Express Lines
Sent by: web400@xxxxxxxxxxxx
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 mailing list archive is Copyright 1997-2020 by midrange.com 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