开发者

output jquery form values into html css box

maybe someone can help me with a problem i'm having. I have captured some form fields as follows:

var $inputs = $('#details :input');

and now i need to output some of them into a html box i've coded that has room for things like name, email etc. These aren't formfields, just normal html.css.

i don't know how to get the values out of the $input开发者_StackOverflows variable, i'm new to jquery and been trying really hard to get it to work.

any help appreciated.


You can loop over the jQuery set invoking .each()help and access each element individually from within the loop:

var $inputs = $('#details input');

$inputs.each(function(index, elem) {
     $('#your_html_box_id').append(elem.value);
});


Try something like

$('input').each(function() {
    alert($(this).val());
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜