js replace string

by Alejandro M

JavaScript

alert("data-123data-".replace('data-',''));//just firt occurrences
alert("data-123data-".replace(/data-/g,''));//all  occurrences