chrisstump
chrisstump
2/22/18 at 10:31 am
JavaScript
jquery

Convert a String to a Slug using jQuery

Use jQuery to convert a string to a slug by making the string lowercase and replacing all spaces with dashes. For example, 'Hello World' becomes 'hello-world'. This is particularly useful when working with URL formatting.

Don't Have an Account?

Stop digging through old code examples. Get organized. Get Code Snipper.

Learn More Start Free 14 Day Trial