| var Parameter_function = (function () { function Parameter_function() { } Parameter_function.prototype.temperature = function (temp_c) { var temp_f; temp_f = (1.8 * temp_c) + 32; return temp_f; }; return Parameter_function; })(); window.onload = function () { var greeter = new Parameter_function(); var temp_c; var temp_f; temp_c = parseFloat(prompt("Enter the value of Temperature in Celsius: ")); temp_f = greeter.temperature(temp_c); var span = document.createElement("span"); span.innerText = "Converted Fahrenheit value is -> " + temp_f; document.body.appendChild(span); }; |