beginner to html, javascript, and stack overflow so take it easy on me. i am trying to get my html to pop up a display that will use the function of the external js file to do calculations, but for now i will keep it simple:
function findA(x, y, z) {
var I = (x*100);
var N = (y/100);
var S = (z+50);
document.write(x,y,z);
}
that is all there is in the js file, now on to the html:
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script src="scripts/main.js"></script>
<![endif]-->
</head>
<body>
<article>
<form>
<fieldset id="button">
<input type="submit" id= "submit" value= "Calculate" onsubmit='findA(1,5,8)'>
</fieldset>
</form>
</article>
</body>
thats it for the html. it should just display one button on html screen. not sure what to do afterwords so any help will be greatly appreciated!
EDIT: *
my new code is this:
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script src="scripts/main.js"></script>
<![endif]-->
</head>
<body>
<article>
<form>
<fieldset id="button">
<input type="button" id= "submit" value= "Calculate" onclick='alert(monthly(1,5,8))'>
</fieldset>
</form>
</article>
</body>
and the js file is:
function monthly(x, y, z) {
var I = (x*100);
var N = (y/100);
var S = (z+50);
var A = ("I: " + I + "N: " + N + " S: " + S);
return A;
}
yet nothing happens when i click calculate. i am using chrome to test this as well as Internet Explorer. i dont see what could be wrong about this. suggestion?