input to array

HTML

<input type="text" name="nom" placeholder="Nom" value=""><br>
<input type="text" name="prenom" placeholder="Prénom" value="tata"><br>
<input type="text" name="age" placeholder="Age" value=""><br>

CSS

/*http://stackoverflow.com/questions/7490203/best-method-to-get-attributes-from-getelementsbytagname*/

JavaScript

//var list = document.getElementsByTagName('input');
/*[0].value;*/
/*.getAttribute("value");*/
//console.log(Array.isArray(list)); // false
//var listArray = Array.prototype.slice.call(list);
//console.log(Array.isArray(listArray)); // true
//console.log(listArray);

/*
var x = document.getElementsByTagName("H1")[0].getAttribute("class"); 
*/

var inputs = document.getElementsByTagName("input");
var message =
   "The form has the following input elements with the 'type' attribute = 'text': \n\n";
 
for (var i=0; i < inputs.length; i++)
{
 
   if (inputs[i].getAttribute('type') == 'text')
   {
      message += inputs[i].tagName +
      " element with the 'value' attribute = '";
      message += inputs[i].getAttribute('value') + "'\n";
   }
}
alert(message);