Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>FdW Ejemplo</title>
</head>
<body>
    <input type = "text" id = "nombre1" value = "hola" />
    <input type = "text" id = "nombre2" value = "hola" />
    <input type = "text" id = "nombre3" value = "hol" />
    <input type = "text" id = "nombre4" value = "hla" />
    <input type = "text" id = "nombre5" value = "hla" />
</body>
</html>
 
var inputs = document.querySelectorAll("[id^=nombre]"),
    aux = [inputs[0].value],
    repetidos = [];
for (var i = 1, l = inputs.length; i < l; i++){
    if (aux.indexOf(inputs[i].value) > -1){
        repetidos.push(inputs[i].id);
    }
    else{
        aux.push(inputs[i].value);
    }
}
console.log("Los inputs que poseen valores repetidos son: " + repetidos.join(", "));
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers