Ignoring this comment after our discussion. parent.length will not be 0 since we set parent=liObj if that would be the case.