Switch to full style
HTML,DHTML,Javascript,XML,CSS
Post a reply

i need help in javascript

Wed Mar 23, 2011 7:44 pm

hello world i am very new to javascript and i need some help in it What is the statement in JavaScript that puts the words The grade is and the result of a calculation stored in mygrade up on the screen? this one of questions i cant answer.. somebody help me! please ty



Re: i need help in javascript

Wed Mar 23, 2011 9:14 pm

You can write on screen using document.write function
Code:

<html>
<
body>
<
script>

document.write(' hello');
</script>
</body>
</html>


You can print what is in variable

Code:

<html>
<
body>
<
script>
var sum=0;
var x=5;
var y=3;
sum=x+y;
document.write(sum);
</script>
</body>
</html>


You can print string : 


Code:

<html>
<
body>
<
script>
var 
description="x+y= ";
var sum=0;
var x=5;
var y=3;
sum=x+y;
document.write(description+sum);
</script>
</body>
</html>



Re: i need help in javascript

Wed Mar 23, 2011 9:36 pm

how about this one : Which loop structure can be set up so that you may or may not enter the loop code?>/p>

Re: i need help in javascript

Wed Mar 23, 2011 9:40 pm

loop ?
like this
Code:

<html>
<
body>
<
script>
 
var 
sum=10;
  for(var 
i=0;i<sum;i++){
    
document.write('Iteration number '+i+'<br/>');
  }

</script>
</body>
</html>


Re: i need help in javascript

Wed Mar 23, 2011 9:45 pm

msi_333 wrote:loop ?
like this
Code:

<html>
<
body>
<
script>
 
var sum
=10;
  for(var i=0;i<sum;i++){
    document.write('Iteration number '+i+'<br/>');
  }

</script>
</body>
</html>


Re: i need help in javascript

Wed Mar 23, 2011 9:52 pm

@themadruski
you quote my reply ! is your problem solved ?

Re: i need help in javascript

Wed Mar 23, 2011 9:53 pm

msi_333 wrote:@themadruski
you quote my reply ! is your problem solved ?
yes and no but thanks anyway bro.

Re: i need help in javascript

Wed Mar 23, 2011 9:59 pm

:( :(

Post a reply
  Related Posts  to : i need help in javascript
 need help with javascript     -  
 what is javascript ?     -  
 JavaScript     -  
 javascript help with BMI     -  
 When to use javascript?     -  
 using javascript     -  
 Javascript     -  
 need help in javascript     -  
 How to use HTML with JavaScript     -  
 javascript programming     -