Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
138
rated 0 times [  144] [ 6]  / answers: 1 / hits: 42367  / 12 Years ago, wed, september 12, 2012, 12:00:00

I am using the following HTML:



<li id=item1 data=icon: 'base.gif', url: 'page.htm', target: 'Page'>Item 1 Title</li>


I am trying to change the Item 1 Title part to something else.



I have tried using:



document.getElementById(item1).innerHTML = Item was changed;


but had no luck. Even tried using:



document.getElementById(item1).value = Item was changed;


but still no luck.



I am only wanting to change the text and leave eveything else the same.



Am I doing something wrong?


More From » html

 Answers
38

try this



window.onload = function(){
document.getElementById(item1).innerHTML = Item was changed;
}

[#83129] Monday, September 10, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jamilab

Total Points: 687
Total Questions: 88
Total Answers: 86

Location: Antigua and Barbuda
Member since Sat, Apr 24, 2021
3 Years ago
;