SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Paris
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    innerhtml and for loops

    Code JavaScript:
    for (var k=0; k<4; k++) {
     
                    alert("cellule source");
     
                    mycurrent_cell1.innerHTML = "cellule source";
     
                    }

    I would like to print the value of innerhtml 4 times in the same table cell, i tried using the for loops no chance, is there another way?
    On a PHP/Java/XML/Javascript/MySQL internship right now!

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
        for(var i = 0; i < 4; i++) {
            mycurrent_cell1.innerHTML += 'cellule source';
            //mycurrent_cell1.innerHTML += 'cellule source<br />';
        }


  3. #3
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Paris
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you
    On a PHP/Java/XML/Javascript/MySQL internship right now!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •