hi i need to add button thath allow to print out list my script display on the screen, i try few thing but button always dissapear after i display list.
can someone help me?
this is my script code:

    <meta charset="utf-8">
    <title>Untitled Document</title>

    var teams = Array(), index = 0;

    function registerTeam()
       //we check if we have 10 elements in array, if so we go to displayTeams function
       if(index == 9){
          teams[index] = document.getElementById('name').value;
       //if not, we put data to array
       teams[index] = document.getElementById('name').value;
       document.getElementById('name').value = '';


    function displayTeams()
       for(var i = 0; i < 10; i++)
          document.write(i+". "+teams[i]+"<br>");
    //printout data from array in order list ;)


    <div id="registration">
       <label>Enter name of team: </label><input id="name" type="text"><button onClick="registerTeam()">Register</button>
    <div id="list"></div>


Can you show the print button code you have used so far with no success?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.