I am dynamically creating text box by clicking on add button.In this I am incrementing a count variable when add button is clicked.How can I get this count value in my PHP file.I have tried window.location but its not working.My code is:
<script>
var counter=1;
function generateRow() {
var count=counter;
var temp ="<div class='_25'>Answer:<input type='textbox' size='100' id='textbox' name='mytext[]"+counter+"' placeholder='Please enter your answer text here.....'></input><input name='' type='button' value='Delete' /></div>";
var newdiv = document.createElement('div');
newdiv.innerHTML = temp + count;
var yourDiv = document.getElementById('div');
yourDiv.appendChild(newdiv);
var js_var=counter++;
xmlhttp.open("GET","tt.php?js_var="+js_var,true);
xmlhttp.send();
}
</script>
tt.php
page?