Webflow sync, pageviews & more.
NEW

Set Div to Today's Date

Example

Set Div to Today's Date

Description

Dynamically add today's date to a div on your Webflow site. A perfect way to easily display the current date on your site without any headaches.

Instructions

  1. Add the Javascript code to your sites body closing custom code section
  2. Set the target div's element ID with output

Javascript snippet


<!-- Add to closing body section -->
<!-- Current date script -->
<script>
var today = new Date();

var day = today.getDate();
var month = today.getMonth() + 1;
var year = today.getFullYear();

if (day < 10) {
  day = '0' + day
}
if (month < 10) {
  month = '0' + month
}

var out = document.getElementById("output");

out.innerHTML = month + "/" + day + "/" + year;

</script>

<!-- Customize the date output -->
<script>
var today = new Date();
    var day = today.getDate();
    var day1 = today.getDate() + 1;
    var day2 = today.getDate() + 2;
    var month = today.getMonth() + 1;
    var year = today.getFullYear();

    var months = new Array(12);
    months[0] = "January";
    months[1] = "February";
    months[2] = "March";
    months[3] = "April";
    months[4] = "May";
    months[5] = "June";
    months[6] = "July";
    months[7] = "August";
    months[8] = "September";
    months[9] = "October";
    months[10] = "November";
    months[11] = "December";

    var out = document.getElementById("milestone1");
    out.innerHTML = month + "/" + day + "/" + year;

    var out = document.getElementById("milestone2");
    out.innerHTML = month + "/" + day + "/" + year;

    var out = document.getElementById("milestone3");
    out.innerHTML = month + "/" + day1 + "/" + year;

    var out = document.getElementById("milestone4");
    out.innerHTML = month + "/" + day1 + "/" + year;

    var out = document.getElementById("milestone5");
    out.innerHTML = month + "/" + day2 + "/" + year;

    var out = document.getElementById("milestone6");
    out.innerHTML = month + "/" + day2 + "/" + year;

    var out = document.getElementById("milestone3m");
    out.innerHTML = months[month] + " " + day1;

    var out = document.getElementById("milestone6m");
    out.innerHTML = months[month] + " " + day2;
</script>

CSS snippet

HTML snippet

Countdown timer

Countdown timer

Add a countdown timer to your Webflow site with this simple Javascript snippet. Want to display a countdown timer to a time of your choosing on your Webflow site? Now you can easily add one with this Javascript snippet.

Reading Time Blog/Article Page

Reading Time Blog/Article Page

Display the reading time associated with a blog or article on your Webflow site with this Javascript code. With this code you'll be able to easily add a reading time to all of your blogs or articles on your Webflow site.

Set referring URL as hidden input

Set referring URL as hidden input

A method to pass the referring domain/URL as a hidden field in a form in Webflow. This is perfect to know who referred the person submitted the form, or a way to display the referring domain on the page on your Webflow site.

Set URL from Tab Change

Set URL from Tab Change

Link to specific tabs using URL parameters by setting tab URLs in Webflow. This script allows you to set the tab name in the elements panel for the tabs that you want the URL to include for each tab. The URL will use the # parameter, for example something like example.com#tabName where tabName is the element ID you set on the tab. This allows you to link to specific tabs from other pages and have more control over the tab experience.

Show/Hide Based on Date or Time

Show/Hide Based on Date or Time

This allows you to show or hide items based on date or time in Webflow. This is great for event based information, you can display various elements based on if its prior to a time or after a specified time on your Webflow site.

Force Links to Inherit Parent Font Color

Force Links to Inherit Parent Font Color

Force your Webflow site links to inherit the parent font color with this simple CSS code snippet. This makes it easier for you to manage your link color on Webflow.

Click to Copy to Clipboard

Click to Copy to Clipboard

Add a click to copy to clipboard to your Webflow site using a Javascript snippet. This copy to clipboard functionality allows you to designate the class and text that you'll allow your users to copy.

Setting & Manipulating Cookies

Setting & Manipulating Cookies

Set, modify and manipulate cookies on your Webflow site via this Javascript code. This allows you to set a cookie, get a cookie, modify a cookie, check a cookie and delete a cookie on your Webflow site.

DRAG
Real-time sorting by
Hide/show Items based on URL Parameter

Hide/show Items based on URL Parameter

Show or hide divs or elements based on the parameter within a URL in Webflow. This Javascript code allows you to make your Webflow site even more dynamic by allowing you to customize elements on the page based on the URL parameter provided.

Reload Page after Form Submit

Reload Page after Form Submit

Automatically refresh your Webflow site's page after a form submit with this Javascript snippet. A great way of indicating that a form has been submitted to a user or refreshing the page for another submission.

Count Up Numbers on Page Scroll

Count Up Numbers on Page Scroll

When scrolling down the page numbers count up as they enter browser view via this Javascript snippet on your Webflow site. An easy way to add number count up to your Webflow site.

SVG Clip-path for Custom Image Cropping

SVG Clip-path for Custom Image Cropping

Create a responsive clip path for images using SVG shapes in Webflow.This allows you to create unique shaped images using SVG paths rather than DIVs or similar methods.

Prevent Input Zoom Scaling on Mobile

Prevent Input Zoom Scaling on Mobile

Prevent an input form zoom scaling on mobile on your Webflow site. This allows for a better user experience based on your sites design rather than mobile OS zoom default properties.

International Flags Phone Number Input

International Flags Phone Number Input

Add international flags to a phone number for input in Webflow. Adding this allows for a unique way of adding international flags to a phone form field in your Webflow site.

Infinite CSS Marquee/Ticker Logo

Infinite CSS Marquee/Ticker Logo

An easy way to utilize CSS for Logo marquees and other sections in your Webflow site. An easier way to create an infinite looping marquee on your Webflow site than creating them manually with Webflow interactions.

Truncate multi-line text with Ellipse

Truncate multi-line text with Ellipse

Do you want consistency with your Webflow designs? Truncate multi-line texts with ellipses based on 2 or 3 lines of your choosing via CSS. This helps keep your designs uniformed without needing to set max height limitations by truncating text that goes beyond a certain length.

DRAG
Real-time sorting by