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>

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();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.