如何从JQuery对象获取javascript控件? [英] How to get javascript control from JQuery object?

查看:77
本文介绍了如何从JQuery对象获取javascript控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JQuery的初学者,

I'm a beginner in JQuery,

如何从JQuery对象中以javascript对象的形式获取控件

How can I get the control as a javascript object from a JQuery object

var _object = $(this). ??

推荐答案

最常见 var _object = $(this)[0];

如果您匹配的元素超过1个:$(this)[0]$(this)[1]$(this)[2],依此类推.

If you have more than 1 elements matched: $(this)[0], $(this)[1], $(this)[2] and so on.

$(this).get()也是可能的.相对于数组模型的唯一优点是,它允许选择类型$(this).get(-1),在该类型中您可以找到最后一个匹配的对象

$(this).get() is also possible. It's only advantage over the array model is that it allows selection of the kind $(this).get(-1) where it gets you the last matched object

这篇关于如何从JQuery对象获取javascript控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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