龙空技术网

jquery 表单常用方法解析

棉花糖攻城狮 169

前言:

现在兄弟们对“多步表单jquery”可能比较讲究,小伙伴们都想要学习一些“多步表单jquery”的相关文章。那么小编也在网络上网罗了一些关于“多步表单jquery””的相关资讯,希望姐妹们能喜欢,小伙伴们快快来学习一下吧!

input选择NAME参数

$("input[name='optionsRadios']").prop("checked",false);

赋值

$("input[name='radioName'][value=2]")

1、$("form :input") 返回form中的所有表单对象,包括textarea、select、button等.

2、 $("form input")返回form中的所有input标签对象.

要想获取某个radio的值有以下的几种方法,直接给出代码:

1.$('input[name="testradio"]:checked').val();2、

1.$('input:radio:checked').val();3、

1.$('input[@name="testradio"][checked]');4、

1.$('input[name="testradio"]').filter(':checked');差不多挺全的了,如果我们要遍历name为testradio的所有radio呢,代码如下

1.$('input[name="testradio"]').each(function(){2.alert(this.value);3.});如果要取具体某个radio的值,比如第二个radio的值,这样写

1.$('input[name="testradio"]:eq(1)').val()

下拉框选择项的value值 $("select").find("option:selected").val();

下拉框选择项的text值 $("select").find("option:selected").text();

jquery select通过value找text

$("#orderstate option[value=" + cellvalue + "]").text();

判断选中

$("#orderstate‘).is(":checked")

标签: #多步表单jquery