how to access the input tag in the form with jquery? (include the hidden type)


I looking for how to access input tag in form via jquery.

I made something like below :


<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test </title>
<script src="/resources/gtl_portal/js/jquery/jquery-2.1.1.min.js"></script>
<script src="/resources/gtl_portal/js/comon.js"></script>
<form id="a" action="#">
    <input type="text" name="name" value=""><br/>
    <input type="text" name="phone" value="numbervalidation"><br/>
    <input type="hidden" name="hiddenParam" value="hidden parameters"><br/>

    <a href="#" onclick="chk()">press</a><br/>
    function chk(){

and in common.js

function checkValidation(formName){
    var form = $('#' + formName);

        var obj = $(this);

I can get value from input tags without hidden type. How can I get hidden type also at once. I found follow article. But if I use this, it looks have to iterate form twice which I do not want to.

Link : jQuery access input hidden value

Is there any way to access hidden and not hidden at once?

Thanks :D

P.S/ I also curious about access multiple selector. I have tried

form.children('input, textarea, select').each(function(i){//do something});

but does not work. Would you find anything wrong from here?

You can use the :input selector. It selects all <input> elements including hidden inputs


Simply selecting the elements by tag name like $("input"); works as well.