I have a function called save changes and it looks like this
function saveChanges() {
var theCity = city.value;
var theState = state.value;
var theEmail = email.value;
var theAge = age.value;
var theGender = gender.value;
var theOther = other.value;
alert("theCity is: "+ theCity);
alert("theState is: "+ theState);
alert("theEmail is: "+ theEmail);
alert("theAge is: "+ theAge);
alert("theGender is: "+ theGender);
alert("theOther is: "+ theOther);
}
window.onload=function (){
document.getElementById('ok').onclick=saveChanges;
}
and I have a simple html page multiple inputs on it.
To submit the content, I have a link at the bottom.
<a href="#" id="ok" style="color:white;">Click here <-- </a>
I have made a button with the same id='ok' and it does not work.
What am I missing?
idis supposed to be unique within the document.