COLON“:”在JQuery选择器中意味着什么?

时间:2017-07-07 12:30:10

标签: javascript jquery jquery-selectors colon

我无法理解JQuery选择器中冒号的功能

$(function() {
    $('.myForm2').on('submit', function(e) {
        var data = $(".myForm2 :input").serialize();
        console.log(data);
        $.ajax({
            type: "POST",
            url: "index.php",
            data: data,
        });
        e.preventDefault();
    });
});

在这种情况下,我猜这将序列化类名称等于“myForm”的表单内的所有Inputs TAGS。

但是如何通过使用此方法获取“myForm”形式中具有某个Class或Id名称的输入?

谢谢你的帮助!

0 个答案:

没有答案
相关问题