JavaScript
Article

jQuery replace all characters with asterisks

By Sam Deering

Use JavaScript to replace all characters with asterisks.

//iVal is your string of characters (with asterisks).
iVal = iVal.substr(i).replace(/[S]/g, "*");
  • Hasanozen

    thank you

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.