Here is a W3schools script on how to do this. Here is a Webflow forum post on how to associate a script with a button click.
Hope this helps.
Best, Christopher