// writes the message
var message=’There are ‘+days+’ days until the event!’;
The above method runs the script and posts the “message” where the script ran. It works okay for small scripts that only update one section of a page.
The below method looks through the HTML of the page for an element with the element ID of p1 and then updates p1’s content with the message.
// updates the element with the name p1