0

Hi guys! I'm trying to get my two variables "firstinput" and "secondinput" to be both NUMBERS and BOLDED. Only I can only get one or the other, but not both at the same time. :(

Any suggestions on how to get them both to work?

<html>
<body>

<h3>Input two numbers</h3>



<script type="text/javascript">

/*script to prompt user to input two numbers and then display its product*/

var firstinput=prompt("Please input first number","")
firstinput=Number(firstinput)
//firstinput=firstinput.bold()


var secondinput=prompt("Please input second number","")
secondinput=Number(secondinput)
//secondinput=secondinput.bold()



//prompt users to input data



document.write("The product of ")

document.write(firstinput) 
document.write(" and ") 
document.write(secondinput) 
document.write(" is ", (firstinput*secondinput),".")//





</script>
</body>
</html>
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by essential
0

From line 14 and 19 in your code. Simply register the two varibles like this:

// #14
firstinput = parseInt(firstinput.valueOf()).bold();
// #19
secondinput = parseInt(secondinput.valueOf()).bold();
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.