Why can't this work

+1 Jeff the Killer · July 25, 2015
<script type="text/javascript">
    var X= 9 * 9;
    document.write(x / 9);

just curious...

Post a Reply


Oldest  Newest  Rating
0 Michael Rosetti · July 25, 2015
It does work, however there's a mistake in your code. First you used a capitalized x, then you changed it when you wanted to print it out. This code will work instead:

<script type="text/javascript">
var x= 9 * 9;
document.write(x / 9);
0 Superman HC · July 25, 2015
at initialization you have capital X... and at the time of print... small x
Moreover... u have to put html tags and insert this script code in the body to display it on the webpage...
0 Jeff the Killer · July 26, 2015
oops... thnx
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.