What alternative methods, besides using PHP, can be employed to dynamically update content in HTML elements like spans using JavaScript?

When updating content dynamically in HTML elements like spans using JavaScript without using PHP, you can utilize AJAX (Asynchronous JavaScript and XML) to fetch data from a server without reloading the entire page. This allows you to update content dynamically based on user interactions or other events. ```javascript // Example AJAX request to update content in a span element var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("span-id").innerHTML = this.responseText; } }; xhttp.open("GET", "your-data-source-url", true); xhttp.send(); ```