I have this code to add row to my table

    function addRow(tableID){
    var table=document.getElementById(tableID);
     var rowCount=table.rows.length;
    var row=table.insertRow(rowCount);
    var colCount=table.rows[0].cells.length;
    var cell1=row.insertCell(0);
    cell1.innerHTML= rowCount+1;
    for(var i=0;i<colCount;i++){
    var newcell=row.insertCell(i+1);
    newcell.innerHTML=table.rows[0].cells[i+1].innerHTML;
    }}

and this for AJAX function

    function CLO() {
    var a=document.getElementById("keyword").value;
    var b=document.getElementById("chapter").value;
        if (a == ""&& b == "") {
         document.getElementById("CLO").innerHTML = "";

        return;
            } else { 
     if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                document.getElementById("CLO").innerHTML = xmlhttp.responseText;

            }
        }

        xmlhttp.open("GET","PLO.php?q1="+escape(a)+"&q2="+escape(b),true);
        xmlhttp.send();
             }
            }

How I can use the same function in the added rows
it working in the first row
I need you recommendation and help
thank you

Be a part of the DaniWeb community

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