javascript - How to "enhance" jQuery search with $(this)? -


i'm looping on children of div.

depending on whether children odd or have different following operations.

i want use jquery's $(this) current context , add query depending on state of being odd or even.

if child want child of div (so child of child loop). how can this?

my current method not work

$("div.profile_result").children().each(function(a){ // way of adding child doesn't work if (a%2) console.log( $($(this) + " > a"))   else console.log("info") }) 

$($(this) + " > a") trying concatenate object , string can't do.

use $(this).find('a') instead


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -