Error output

Error output

Can anyone please assist me; The printed output should be:

The product is 10. But instead of it I got; The product is undefined.
Can anyone trace what went wrong of my code pls?

===========================================================================

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Do Me</title>
<script type="text/javascript">
function Do(){
var product;
var x;
x = 10;
product = 1;
product = product * x;
document.getElementById('result').innerHTML = "The products is "
+ product.value + "!";
}
</script>
</head>
<body onload="Do()">
<div id="result"></div>

</body>
</html>
View Answers

February 1, 2010 at 10:32 AM

Hi Friend,

Try the following code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Do Me</title>
<script type="text/javascript">
function Do(){
var product;
var x;
x = 10;
product = 1;
product = product * x;
document.getElementById('result').innerHTML = "The products is "
+ product+ "!";
}
</script>
</head>
<body onload="Do()">
<div id="result"></div>

</body>
</html>

Thanks









Related Tutorials/Questions & Answers:
output error
output error  this is my program import java.io.*; public class separate { public static void main(String[] args)throws IOException...]; for (k=0;k } } if i enter "my name" as the input the output
Error output - JSP-Servlet
Error output  Can anyone please assist me; The printed output should be: The product is 10. But instead of it I got; The product is undefined. Can anyone trace what went wrong of my code pls
Advertisements
output error - JSP-Servlet
output error  /*hi friends, the given below is my servlet program error? How can i solve this problem? */ HTTP Status 500... report message description The server encountered an internal error
I/O Program output error
I/O Program output error  Hello All, I am working on a program that requries me to read and analyze a .txt file and output the results to a .txt file, but I am getting incorrect output. I have been successfull with part
output
output  Sir,I am experiencing some problems with the output of this program.I got some useful help this website,but the output of the program isn't producing what it should.let me explain the output below is what happen when
Error
state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower it shows me proper output. Please anybosy can give me remedy on that..... Thank you
error
error  while iam compiling iam getting expected error
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version.ADS_TO_REPLACE_1 This type error also comes
error
error
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during deployment: Exception while deploying the app [HelloWorld
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern = /^\d{3,5
error
"+it); } } this is my program i am getting an error saying cannot find symbol class stringADS
error
error  whats the error.............. import java.util.Scanner; public class g { public static void main(String[] args) { Scanner s=new Scanner(System.in); int d,x,y; System.out.println("Enter the first number
Output of flex
Output of flex  hi....... please provide the name of the output file. What is the output of flex applications? please rply ASAP........ Thanks
triangle output
triangle output  program to get the following output
output variable
output variable  if i want to print output of three variables when i wrote the code e.g SYStem.out.PRINTln(answer + answer1 + answer 2) only output of answer is getting printed out? can you help
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly.ADS_TO_REPLACE_1 Thanks
What is the output if....
What is the output if....  Here is my code. what is the output...;When we put 50 as a lower limit value, output comes: (adsbygoogle... violation. After the catch block When we put 150 as a lower limit value, output
What will be the Output?
What will be the Output?  int[] number = {5,3,6,10,1} int temp; for (int i=0; inumbers[j]) { temp=numbers[i]; numbers[i]=numbers[j] number[j]=temp
output of the program
output of the program  public static int sum(List list) { int sum = 0; for ( Iterator iter = list.iterator(); iter.hasNext(); ) { int i = ((Integer)iter.next()).intValue(); sum += i; } return sum
input output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part... used for writes byte to output stream. It implements a buffered output
xml output
xml output  generate an xml output in the following format <FileCount> <DOC>AA <RTF>BB <PDF>CC <Total>DD where AA=total number of .DOC files found BB=total number of .RTF files found,etc
what is the output?
what is the output?  public class MyAr{ public static void main(String argv[]) { int[] i=new int[5]; System.out.println(i[5]); } }   It gives ArrayIndexOutOfBoundsException as you haven't add element to array. Correct
what will the output
= (Parent) sonu; p.play(); What will be the output of above section of code
ModuleNotFoundError: No module named 'output'
, ModuleNotFoundError: No module named 'output' error will be solved. Thanks...ModuleNotFoundError: No module named 'output'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
Input and Output package
Input and Output package  Hi guys, My professor used input and output... she used in.readint() out.writeln() commands to read input and print output. she created two new objects directly to use this statements. /* input and output
ModuleNotFoundError: No module named 'colcon-output'
'colcon-output' error? Thanks   Hi, In your python...;colcon-output' error will be solved. Thanks...ModuleNotFoundError: No module named 'colcon-output'  Hi, My
ModuleNotFoundError: No module named 'list_output'
;list_output' error? Thanks   Hi, In your python environment...ModuleNotFoundError: No module named 'list_output'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'matrix_output'
'matrix_output' error? Thanks   Hi, In your python...;matrix_output' error will be solved. Thanks...ModuleNotFoundError: No module named 'matrix_output'  Hi, My
ModuleNotFoundError: No module named 'Output_item'
;Output_item' error? Thanks   Hi, In your python environment...ModuleNotFoundError: No module named 'Output_item'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'output_matrix'
'output_matrix' error? Thanks   Hi, In your python...;output_matrix' error will be solved. Thanks...ModuleNotFoundError: No module named 'output_matrix'  Hi, My
ModuleNotFoundError: No module named 'output_package'
'output_package' error? Thanks   Hi, In your python... 'output_package' error will be solved. Thanks...ModuleNotFoundError: No module named 'output_package'  Hi, My
ModuleNotFoundError: No module named 'PLP-Output'
-Output' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'PLP-Output'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'PLP-Output'
-Output' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'PLP-Output'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'quartet_output'
'quartet_output' error? Thanks   Hi, In your python... 'quartet_output' error will be solved. Thanks...ModuleNotFoundError: No module named 'quartet_output'  Hi, My
ModuleNotFoundError: No module named 'tree_output'
;tree_output' error? Thanks   Hi, In your python environment...ModuleNotFoundError: No module named 'tree_output'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'accessible_output'
named 'accessible_output' error? Thanks   Hi, In your...: No module named 'accessible_output' error will be solved. Thanks...ModuleNotFoundError: No module named 'accessible_output'  Hi, My
ModuleNotFoundError: No module named 'colcon-output'
'colcon-output' error? Thanks   Hi, In your python...;colcon-output' error will be solved. Thanks...ModuleNotFoundError: No module named 'colcon-output'  Hi, My
ModuleNotFoundError: No module named 'file_output'
;file_output' error? Thanks   Hi, In your python environment...ModuleNotFoundError: No module named 'file_output'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
what is given output?
what is given output?  public class { public static void main(string argv

Ads