I am writing a simple javascript function that grabs information out of three text areas. Pretty basic, but for some reason javascript is telling me that my variables are not defined and I am confused as to why.
The html is as followed:
<input type = "text" id = "month" name = "month"/>
<input type = "text" id = "day" name = "day"/>
<input type = "text" id = "year" name = "year"/>
<input type = "button" id = "submit" value = "Go!" onClick = "calculate(month, day, year)"/>
The javascript is simply
function calculate(month, day, year){
var setMonth = document.getElementById(month).value;
var setDay = document.getElementById(day).value;
var setYear = document.getElementById(year).value;}
And when I run this and click my button, it says "month is not defined" in Firebug. So I am a little confused, since ... they are defined!