This is because: even the selector is useful only in the list, but the parent object refers to only one object. Therefore: even with list 1 it makes no sense.
However, you have identifiers indicating the line number
var position = parent.attr("id").substr(4) % 2 == 0; console.log(position);
extracting the identifier and deleting the line "line" from the line "lineX" gives you the line number X. Check with MOD 2 (or alternatively bitwise And with 1 :)
var position = ((parent.attr("id").substr(4) & 1) == 1);
will do the trick.
source share