Hot to get all form elements values using jQuery?

后端 未结 9 1651
谎友^
谎友^ 2020-12-22 23:45

Here is the HTML code:



    HTML Form Builder         


        
9条回答
  •  礼貌的吻别
    2020-12-23 00:33

    The answer already been accepted, I just write a short technique for the same purpose.

    var fieldPair = '';
    $(":input").each(function(){
    fieldPair += $(this).attr("name") + ':' + $(this).val() + ';';
    });
    
    console.log(fieldPair);
    

提交回复
热议问题