replace all spaces with dash in javascript
snippet in javascript

replace all spaces with dash in javascript

user6269

title = title.replace(/\s/g , "-");
var html = "<div>" + title + "</div>";
// ...