Jump to content

Search the Community

Showing results for tags 'javascript loop'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi, please refer to this script for my question:-----------------------------------------------------------------------------------------------------------------------------<body><p>Click the button to loop through a block of code five times.</p><button onclick="myFunction()">Try it</button><p id="demo"></p><script>function myFunction(){var x="",i;for (i=0;i<5;i++) { x=x + "The number is " + i + "<br>"; }document.getElementById("demo").innerHTML=x;}</script></body>---------------------------------------------------------------------------------------------------------------------------it is a for loop question....1) since x="", then what is value of x in the second loop , third loop and so on. 2) even if x is given a numeric value, it is displayed in the first loop and that's it...not in the other loops...??? y? 3) if x="sss"...just to check the behavior of x....i got the o/p as sssThe number is 0The number is 1The number is 2The number is 3.....so on y "sss" is not addded to the remaining loop pls help...even loop by loop explanation of for loop with help me a lot in understanding it better. thanks
×
×
  • Create New...