<script> document.getElementById("message").innerHTML = "Hi there!"; </script>
<div id='message'><?php echo 'Hi there!'; ?></div>
Most websites make use of both a client-side and a server-side language. While you can do things with both, there are certain tasks that only one can do. Client-side is good for anything that requires user interaction like clicking buttons. Server-side is good for anything that requires dynamic data to be loaded like search results. Ultimately, you must evaluate your needs and decide which way works best for your needs. It is not a one size fits all. If you need some assistance figuring it out you can always reach out to User X for help.