Since I want to display the current time in several places after the page is loaded, I need to assign values to multiple spans.
The span code is written as follows:
(multiple spans)
jQuery writing:
<script> <br>$(document).ready(function() { <br>var currentDate = new Date().toLocaleDateString (); <br>$("span[name='currentDate']").each(function() { <br>$(this).text(currentDate); <br>}); <br>}) ; <br></script>