php - xmlhttp.responseText to html code -


i trying display xmlhttp.responsetext html code , fill dropdownbox, seems processed string , not html code.

i using code display in html format various menu <option>s in <span> tag

javascript code within xmlhttprequest function:

document.getelementbyid("test").innerhtml=xmlhttp.responsetext; 

code in html found within dropdown menu:

< span id="test">  < /span> 

the php file called xmlhttprequest echo's following:

$option="&lt;option&gt;"; 

(this in while loop)

{     echo  $option.$row['productname'].$option="&lt;option&gt;"; } 

if want html outcome use html, don't use special chars.

in loop use

echo "<option>" . $row['productname'] . "</option>"; 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -