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?
try this
window.onload = function(){
document.getElementById("item1").innerHTML = "Item was changed";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With