PDA

View Full Version : not working javascript help needed!



whatzzup
Dec 9th, 2014, 09:44 PM
hello people, im new to this website and i have javascript on school. This problem sounds really nooby but i need some help with my script. It is not working how i want it to do. and i dont know how to fix it. can somebody help.
this is my script at the moment:



<script>
var achter = "";
var roep = "";
var spaarb = "";
var tien = 10000;





achter= prompt("voer je achternaam in");
roep= prompt("voer je roepnaam in");
spaarb= prompt("je spaarbedrag is");
document.write("<h3>"+achter+" "+roep+" </h3><br />");

if (spaarb < tien)
{
docement.write("1,5% rentevergoeding");
}
else
{
docement.write("2% rentevergoeding");
}




</script>

sunfighter
Dec 9th, 2014, 11:53 PM
This:

if (spaarb < tien)
{
docement.write("1,5tevergoeding");
}
else
{
docement.write("2tevergoeding");
} Has misspelling Should be 'document' Not 'docement'

This
document.write("<h3>"+achter><br />");
Should be:
document.write("<h3>"+achter+"</h3>");

whatzzup
Dec 10th, 2014, 08:35 AM
thanks :D