简体   繁体   中英

Echoing using PHP to an existing div

I have a PHP function which returns this:

echo '<li>Welcome back.</li>' I would like that echo to be appended to an existing div on the html called <div id="messages"></div>

Is there any way of doing this with just simple echo or I should use Jquery?

Thanks!

if you are using php all you can do is to run your function inside the div

<div id="messages">
    <?php run_function_here();?>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM