Gerry Studios Gerry Studios - 1 year ago 110
jQuery Question

Change element's innertext with php

I want to change a innerText of a element using php (I also use jquery); and I've tried this:

$variable = "Hello";
echo '<script>$('#element').text($variable);</script>'

But it didn't work. I've also tried with:

document.getElementsById('element').innerText = $variable;

Answer Source


 document.getElementById('element').innerHTML = $variable;


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download