Copy link to clipboard
Copied
hi all,
is there a way to have the span id display more than 1x (the 1st shows up but not the next one) without extra javascript document.getElementById('name2***').textContent = "bob";?
html....
1 - the name is <span id="name"></span>
this doesn't show 2nd time
2 - again the name is <span id="name"></span>
<script>
document.getElementById('name').textContent = "bob";
</script>
ID = a unique identifyer. It doesn't matter what it is used on -- div, span, p etc... It can be used only 1 x per page. That's absolute & written in stone.
Copy link to clipboard
Copied
ID = a unique identifyer. It doesn't matter what it is used on -- div, span, p etc... It can be used only 1 x per page. That's absolute & written in stone.
Copy link to clipboard
Copied
Thanks Nancy - good to know
Copy link to clipboard
Copied
HTML ID's can only be used once per page.
Not sure what you're attempting exactly, but maybe this would work better with a class...HTML DOM getElementsByClassName() Method
Copy link to clipboard
Copied
Of course that will invoke all of the same classes to fire at the same time; not separately.
Nancy O.
Copy link to clipboard
Copied
Thanks you Nancy & Jon - very helpful!
Copy link to clipboard
Copied
Hi Jon - that looks interesting - I'll give it a try
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more