-3

I want to get value from

 <input type="text" name="Phone[]" id="Phone"> 

by javascript. How to do it? please help me.

  • a simple google search would have given you this. Plus please also mention in the question what you have tried. – Parv Sharma Nov 26 '14 at 07:24

1 Answers1

-1

Maybe it is me who don't know HTML5 enough but what do you mean by "element Array".

The value of an input text is, if I am not mistaken, always a String so there is no array.

if you want all the inputs with a special class and then get the values as an array, you can do it like that:

$("input .phone").each(function(elem){return elem.val();});

and this will be an array of string

Did I answer your question?

No Idea For Name
  • 11,411
  • 10
  • 42
  • 70
  • I have a button to add phonenumber and remove it , how i can check phonenumber in input by javascript ? i mean about it . and sorry to Ask question not clear. – Pinich Aksornpan Nov 26 '14 at 07:34