Posted By

xtheonex on 05/07/09


Tagged

javascript jquery permalink


Versions (?)

Javascript/jQuery permalink converter...


 / Published in: JavaScript
 

A lovely little one liner that strips out all non alphanumeric chars first, then replaces the spaces with hyphens, then converts all to lowercase :D

  1. $('#permalink').val($(this).val().replace(/\s/g, '-').replace(/[^\w/-]/g, '').toLowerCase());

Report this snippet  

You need to login to post a comment.