replace input text

by Ifnak

HTML

<input type="text" name="sample1" value="Hi 1"><br>
<input type="text" name="sample2" value="Hi 2"><br>
<input type="password" name="sample3" value="Hi 3"><br>
<input type="checkbox" name="sample4"  value="Hi 4"><br>

JavaScript

(function() {
    var x, n, o, i = 0,
        t = document.createElement('TEXTAREA');
    t.rows = 3;
    while(x = document.getElementsByTagName('INPUT')[i]) {
        if (x.type === "text") {
            n = x.parentNode.insertBefore(t.cloneNode(), x);
            x.parentNode.removeChild(x); 
            n.id = x.id;   
            n.name = x.name;
            n.innerText = x.value;
        } else { 
            ++i;   
        }
    }
})();