p").foo(); do something...">

Adding a string to this in jQuery

If this one is an HTMLDivElement, how can I avoid this?

$('#' + $(this).id + " > p").foo();

do something like:

($(this) + $( " > p")).foo();
+3
source share
2 answers
$(this).children('p').foo();
+9
source

Try the following:

$(this).find("> p").foo();
+3
source

Source: https://habr.com/ru/post/1743727/


All Articles