📌  相关文章
📜  电子邮件地址隐藏字符 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:41.929000             🧑  作者: Mango

代码示例1
function hideemail(target) {
  var email = target //anas.behhari@gmail.com
  var hiddenEmail = "";
  for (i = 0; i < email.length; i++) {
    if (i > 2 && i< email.indexOf("@") ) {
      hiddenEmail += "*";
    } else {
      hiddenEmail += email[i];
    }
  }
  console.log(hiddenEmail) //an.*******@gmail.com
}