samedi 31 janvier 2015

how to access value hidden elements using loop


Vote count:

0




what i need



  • i need to fetch hidden element data according to particular element id.


a.html



<input type="hidden" id="evt_date" value="feb 10">
<input type="hidden" id="evt_date" value="Mar 21">
<input type="hidden" id="evt_date" value="april 05">


js



<script>
$.each($('input'),function(i,val)
{
if($(this).attr("type")=="hidden")
{
var event_date= document.getElementById('evt_date');

console.log(event_date);
}
});


problem




  • on doing console.log im getting



    <input type="hidden" id="evt_date" value="feb 10">


  • i want to fetch all hidden element in loop using js.



asked 3 mins ago







how to access value hidden elements using loop

Aucun commentaire:

Enregistrer un commentaire