How to show results of a function in HTML
I am a student learning JavaScript and I am trying to output the results
of this function:
function randInt(lower, upper) {
var size = randInt(1,10);
return Math.floor(lower + size*Math.random());
}
Here is the HTML I am trying to place the output in:
<h1>Random Tip<br />
<script type="text/javascript">
var tipNum = Math.floor(lower + size*Math.random());
document.write("<p>" +randInt(lower, uppers)+ "</p>");
</script>
I am totally screwing this one up!! Suggestions please!
No comments:
Post a Comment