Run a JQuery script only on childs of one element -


is there easy way of running jquery script on 1 specific form , it's children without effecting other forms on website.

at moment use child selector other selector, there command following selectors match within children of form?

thanks

you can use find:

$('#myform').find('.otherclass').css({color: 'red'}) 

the selector .otherclass searched inside #myform.

and small refactoring:

var $f = function(selector) { return $('#myform').find(selector); } 

you can use:

$f('.otherclass').css({color: 'red'}) 

to scoped version of jquery function.


Comments

Popular posts from this blog

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -