nekonezinu Posted June 24, 2008 Report Share Posted June 24, 2008 java script:alert(document.getElementById("lauks")value); - parāda pirmā input lauka tekstu java script:alert(document.getElementById("lauks")[6].value); - neko nerāda Kā man dabūt kada noteikta input lauka tekstu, vai ari visu lauku tekstus!? Link to comment Share on other sites More sharing options...
andrisp Posted June 24, 2008 Report Share Posted June 24, 2008 Vispaar jau getElementByID atgrieziis tikai vienu elementu, taapeec taads [6] nemaz idejiski nav iespeejams. document.getElementById('lauks').value vajadzeetu straadaat. Link to comment Share on other sites More sharing options...
nekonezinu Posted June 25, 2008 Author Report Share Posted June 25, 2008 Ko man izmantot lai iegūtu kada noteikta, labāk visu, input lauka tekstu, ja visiem id,class ir vienads!? Link to comment Share on other sites More sharing options...
bubu Posted June 25, 2008 Report Share Posted June 25, 2008 id nedrīkst būt vienāds. Tam ir jābūt unikālam! Tāpēc jau tas ir id. Link to comment Share on other sites More sharing options...
Klez Posted June 25, 2008 Report Share Posted June 25, 2008 liec katram savaadaaku id Link to comment Share on other sites More sharing options...
nekonezinu Posted June 25, 2008 Author Report Share Posted June 25, 2008 (edited) viss ok! Risinājums: function a(){ var a = document.getElementsByTagName('input'); for (var i=0;i<a.length;i++) { b = a.value; c = document.getElementById("aiai").innerHTML; d = document.getElementById("aiai").innerHTML=c+'<br>'+b; } } <a onclick="a()">Paradit visu input lauku vertibas</a> <div id="aiai"></div> Edited June 25, 2008 by nekonezinu Link to comment Share on other sites More sharing options...
Recommended Posts