jQuery Chain this with selector -


is possible chain 'this' other selectors

i.e

var testvar =jquery(this.label.text()).val(); 

jquery selector accepts string parameter , based on return jquery object or array jquery objects.

assuming trying find element , element selector match stored element can this

$("a.button").click(function(){     var element = $($(this).data("elementid")); }); 

where anchor looks :

<a href="#" data-elementid="#firstelement">find</a> 

and target element :

<div id="firstelement"></div> 

from case can reference element one.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -