Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #31713
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2016-11-13 10:01 -0800 |
| Message-ID | <62558672-b8d4-495a-8ccf-4bce9399d64d@googlegroups.com> (permalink) |
| Subject | How to reference an updated document object and to have all of its elements and associated values if any as well? |
| From | justaguy <lichunshen84@gmail.com> |
Start:
<html>
<head>
<script>
var addEle = function() {
var newEl = document.createElement('span')';
document.body.appendChild(newEl);
// other types of elements addition as well, ie. input
}
</script>
</head>
<body>
<button onclick="addEle">Add Element</button>
</body>
</html>
Process:
A user adds some elements to the page (document).
Question:
Now, how do I reference / retrieve all the elements and associated values if any for this document?
document.all was for old IE browser only, hence, irrelevant for other modern browsers.
Thanks.
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
How to reference an updated document object and to have all of its elements and associated values if any as well? justaguy <lichunshen84@gmail.com> - 2016-11-13 10:01 -0800
Re: How to reference an updated document object and to have all of its elements and associated values if any as well? Martin Honnen <martin.honnen@gmx.de> - 2016-11-14 12:40 +0100
Re: How to reference an updated document object and to have all of its elements and associated values if any as well? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-11-14 14:16 +0100
Re: How to reference an updated document object and to have all of its elements and associated values if any as well? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-11-14 17:26 +0100
Re: How to reference an updated document object and to have all of its elements and associated values if any as well? justaguy <lichunshen84@gmail.com> - 2016-11-14 12:48 -0800
Re: How to reference an updated document object and to have all of its elements and associated values if any as well? JJ <jj4public@vfemail.net> - 2016-11-14 18:51 +0700
csiph-web