Miss client billing? We do.

Leverage the unparalleled capabilities of OpenAI's GPT4 most recent language model to enhance your Webflow development.

Primed for working with JavaScript within the context of Webflow.

By clicking Sign Up you're confirming that you agree with our Terms and Conditions.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Datamaker
How do I display the current year in a text span?
To display the current year in a text span using JavaScript and Webflow, follow these steps:

1. Add a text element to your Webflow project and give it a unique ID (e.g., `current-year`).

2. Add an Embed element to the page where you want to run the script to update the text span.

3. Inside the Embed element, add the following code:

<script>  document.addEventListener("DOMContentLoaded", function () {    var currentYear = new Date().getFullYear();    document.getElementById("current-year").innerText = currentYear;  });</script>

Replace "current-year" with the ID you assigned to the text element in step 1. Now, when the page loads, the current year will automatically populate in the designated text span.
Give Feedback
Logged in as Jason | Log out

Want to Beta test?

Chuck your email in the form below and we'll let you know when you have access to test... for free!

By clicking Sign Up you're confirming that you agree with our Terms and Conditions.
We'll email you with updates.
Keep watching your inbox.
Oops! Something went wrong while submitting the form.