I am trying to create a webpage that will give me the sunrise and sunset times and am using a script I found on GitHub. Below is my code...
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<script src="sun.js"></script>
</head>
<body>
<input type="hidden" id="sunrise" value="" />
<input type="hidden" id="sunset" value="" />
<script>
navigator.geolocator.getCurrentPosition(function(position)){
sunrise = new Date().sunrise(position.coords.latitude, position.coords.longitude)
sunset = new Date().sunset(position.coords.latitude, position.coords.longitude)
}
document.getElementById('sunrise').value = sunrise;
document.getElementById('sunset').value = sunset;
</script>
//Want to put code here to print out the value of sunrise/sunset
</body>
</html>
How would I go about printing the variable value in the HTML body?