mi serve per una cosa fatta in ajax e php
la stringa restituita dall'php chiamato dall'ajax è html
mi serve fare un javascript indipendente dal browser
ke fa il confronto tra quello scritto in un div e quello prestituito dall'ajax-php
l'esempio fatto nn funziona perche restituisce sempre codici diversi
codice:<html> <head></head> <script> function show_html(){ alert(document.getElementById('campo').innerHTML); document.getElementById('content').innerHTML=document.getElementById('campo').innerHTML; } function show_text(){ alert(document.getElementById('campo').textContent); document.getElementById('content').innerHTML=document.getElementById('campo').textContent; } function show_TT(){ alert(document.getElementById('campo').innerText); document.getElementById('content').innerHTML=document.getElementById('campo').innerText; } </script> <body> <div id="campo"> <font face="verdana" color="red">ciao</font> <font face="verdana" color="blue">come va?</font> </div> Copia del div: <div id="content"></div> <input type="button" value="clicca e vedi l'HTML " onclick="show_html()"> <input type="button" value="clicca e vedi il testo " onclick="show_text()"> <input type="button" value="clicca e vedi il text" onclick="show_TT()"> </body> </html>