I'm Loading in content from view_login.php into index.php´s div id="display"
using ajax javascript
var hr=new XMLHttpRequest();
hr.open("GET", 'view_login.php', true);
hr.onreadystatechange = function(){
if(hr.readyState == 4 && hr.status == 200){
var return_data = hr.responseText;
document.getElementById('display').innerHTML = return_data;
}
}
hr.send();
Rather than echo $output
i would just target the div itself.
PHP/HTML
$output = '
<div id="visible">
<form>
<input type="text" name="name"/>
<input type="submit" />
</form>
</div>';
echo $output;
is it possible to just target the div visible
and it contents instead of every ouput on the page? without using jquery and just plain/raw javascript.