how to use an element's JS variables to get the current year? #215
Unanswered
yotamguttman
asked this question in
Q&A
Replies: 2 comments
-
You can use the 'HTML embed' Component to do that. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here's an approach using an HTML Embed: https://bsky.app/profile/bryanbemis.bsky.social/post/3lifnwoqdkn2d And here's another approach using a data variable on the Global Root: https://bsky.app/profile/bryanbemis.bsky.social/post/3lj4zm6z2hc2t |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
how do you use an element's variables to fetch information such as the current year?
I don't understand how to take a js code and break it into a variable's fields
code: const currentYear = new Date().getFullYear();
available fields in webstudio: name, type, value
I broke webstudio's AI when I told it to add a copywrite footer statement and have the year update automatically 😅

ps.
I hope no one has asked this question before, I couldn't find anything related. it's not necessarily related to webstudio but I just wanted to learn.
Beta Was this translation helpful? Give feedback.
All reactions