loop through elements with jquery? -


I have never looped through elements with jquery and it would be great with some help.

my dome looks like this:

  & lt; Div class = "section" & gt; & Lt; Div class = "group" & gt; & Lt; Div class = "comment" & gt; & Lt; Input class = "comment" type = "text" /> & Lt; Br / & gt; & Lt; / Div & gt; & Lt; Div class = "link" & gt; & Lt; Input class = "link" type = "text" /> & Lt; Input class = "link" type = "text" /> & Lt; Br / & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "group" & gt; & Lt; Div class = "comment" & gt; & Lt; Input class = "comment" type = "text" /> & Lt; Input class = "comment" type = "text" /> & Lt; Br / & gt; & Lt; / Div & gt; & Lt; Div class = "link" & gt; & Lt; Input class = "link" type = "text" /> & Lt; Br / & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

How do I write code to get all values ​​in text input fields (class = comment and class = link)? There will be a lot of groups with different text input fields.

Thank you!

  $ (": input.com, input.link"). Each (function () {warning ($ (this) .val ()); // or this.val});  

See:


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -