Put all your JavaScript statement in onclick clause
<html> <head> <title>A Simple Page</title> </head> <body> <p onclick="units = prompt('value');alert(units + ' is ' + units * 9.99);">Click here to specify quantity</p> </body> </html>