I have this simple Java Script code to display the date.
I want to take the results from the js, and to show them within a specific html in the document. Example; div, p, h3, etc.
If I place the script in the tag, it will overwrite my existing html page.
How can I display the date in a specific tag within the html page?
<script language="JavaScript">
<!--
var current_date = new Date ( );
var month_names = new Array ( );
month_names[month_names.length] = "January";
month_names[month_names.length] = "February";
month_names[month_names.length] = "March";
month_names[month_names.length] = "April";
month_names[month_names.length] = "May";
month_names[month_names.length] = "June";
month_names[month_names.length] = "July";
month_names[month_names.length] = "August";
month_names[month_names.length] = "September";
month_names[month_names.length] = "October";
month_names[month_names.length] = "November";
month_names[month_names.length] = "December";
document.write ( month_names[current_date.getMonth()] );
document.write ( " " + current_date.getDate() );
document.write ( " " );
document.write ( " " + current_date.getFullYear() );
// -->
</script>
http://jsfiddle.net/22MVm/1/