I am trying to change john to mike. I have no idea why its not working.
<span id="user">John</span>
I am trying this but not working i have no clue why not working.
function set() {
document['getElementById']('user')['value'] = Owner;
// owner value is mike
}
span
tag has a value? – Perlobj.key
syntax instead ofobj['key']
? For static keys that's the way to go. Nobody expectsdocument['getElementById']
instead ofdocument.getElementById
– Abjuration