Heim >Backend-Entwicklung >PHP-Tutorial > document.getElementById('text1'). 话语解析!
document.getElementById('text1').**** 语句解析!!!
需要前后文代码吗?
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> var xmlhttp; function hello(){ xmlhttp=ajax1(); var a=document.getElementById('a').value; var b=document.getElementById('b').value; var url='demo02.php?a='+a+'&b='+b; xmlhttp.open('get',url); xmlhttp.onreadystatechange=display; xmlhttp.send();} function display() { if(xmlhttp.readyState==4 && xmlhttp.status==200) document.getElementById('text1').value=xmlhttp.responseText; }
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> A<input type="text" id="a"><br> B<input type="text" id="b"><br> 和是:<div id="text1"></div> <input type="button" value="点击" onclick="hello()">