获取< input>的属性名称值 [英] Get attribute name value of <input>

查看:63
本文介绍了获取< input>的属性名称值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jQuery获取输入标签的属性名称值.请帮忙.

How to get the attribute name value of a input tag using jQuery. Please help.

<input name='xxxxx' value=1>

推荐答案

输入一个ID并使用 attr 方法:

Give your input an ID and use the attr method:

var name = $("#id").attr("name");

这篇关于获取&lt; input&gt;的属性名称值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆