Hello,
today i am facing a strange problem that i never face before.
form.php
<td><div id="test"><? echo $project;?></div></td>
ajax.js
var test=document.getElementById("test").value;
alert(test);
out put is ‘undefined’
form.php
<td><input id="test" name="" type="text" value="<? echo $project;?>" /></td>
ajax.js
var test=document.getElementById("test").value;
alert(test);
out put is ‘G4’ which works!!
So why it is not working when i put the php value inside a div? i also tried a label. that also not working. coz i do not want to use a text box here.