Hi @gilles,
To actually use this code in your Bubble project you would use Run JavaScript in conjunction with the JavaScript to Bubble element to return the value back into Bubble where you can actually use it.
This is probably most easily explained via video, so here’s a video (and, yes, I show you how to log the value to the console as well… and a few other things):
Here’s the runtime of the project I build in this example (link to editor in the page):
Best Regards,
Keith
#lockdownandlearnwithkeith