
220 Ga. 665 (1965)
141 S.E.2d 161
WILBANKS
v.
WILBANKS.
22812.
Supreme Court of Georgia.
Argued January 12, 1965.
Decided February 4, 1965.
Rehearing Denied February 18, 1965.
Melton, McKenna & House, for plaintiff in error.
Adams, O'Neal, Steele, Thornton & Hemingway, Richard B. Thornton, Jack J. Gautier, Solicitor General, contra.
ALMAND, Justice.
This is an appeal from the order of the Juvenile Court of Bibb County awarding custody of Anthony Gordon Wilbanks, aged three, to his father, Gordon Wilbanks.
Gordon Wilbanks brought this action against his former wife, Mary Jane Wilbanks. In his petition he alleged: that the defendant was awarded custody of Anthony Gordon Wilbanks in 1962; that the defendant had not given proper care and attention to the child; that the defendant had engaged in immoral conduct; that the defendant had "committed an act of illegal, illicit and unlawful sexual intercourse, not having been married at the time and that her standard of conduct has so deteriorated that she is incapable and unfit to provide said minor child with proper moral training," and that as a result of such illegal sexual intercourse defendant has given birth to an illegitimate child; that there has been a change in conditions substantially affecting the welfare of the child. It was further alleged in the petition that the plaintiff had remarried and was a fit and proper person for the custody and care of the child. The defendant filed a cross action alleging that the plaintiff had unlawfully taken and was illegally detaining the child. Both parties prayed to be awarded custody of the child. After a trial before the judge *666 without a jury, an order was entered awarding custody of the child to the plaintiff. By bill of exceptions, the defendant assigns error on this order.
1. The first assignment of error is on the ground that the Juvenile Court of Bibb County does not have jurisdiction of the subject matter involved in this case. Originally, the petition in the case at bar "for change of custody of a minor child of the divorced parents in the nature of a habeas corpus" was filed in the Superior Court of Bibb County. That court issued an order transferring the case to the Juvenile Court of Bibb County "with full authority to determine all issues as to the custody of said child." After the case was transferred to the Juvenile Court of Bibb County, the defendant filed a cross action alleging an illegal detention of the child. Code Ann. § 24-2409 (2) (Ga. L. 1951, pp. 291, 298-299) gives the juvenile courts jurisdiction of such a case. That Code section provides: "Courts of record in handling divorce or habeas corpus cases involving the custody of a child or children, may transfer the question of the determination of custody and support to the juvenile court for investigation and report back to the superior court or for investigation and determination. The juvenile court then shall proceed to handle the matter in the same manner as though the action originated under this Act, in compliance with the order of the superior court." The defendant contends that the instant case is not a habeas corpus proceeding. However, defendant's own allegations in her cross action of an illegal detention of the child by the plaintiff and the prayer that custody of the child be returned to defendant clearly raise the issue of an illegal detention, and an illegal detention or restraint is the gist of a proceeding for habeas corpus. See Code § 50-101; West v. Hatcher, 219 Ga. 540 (134 SE2d 603).
Nothing contained in Art. VI, Sec. IV, Par. I of the Georgia Constitution of 1945 (Code Ann. § 2-3901) which vests exclusive jurisdiction in the superior courts "in cases of divorce" requires an opposite result, since it was held in Fortson v. Fortson, 200 Ga. 116 (35 SE2d 896) that the phrase "in cases of divorce" does not include the determination of custody of minor children.
The Juvenile Court of Bibb County had jurisdiction of the subject matter involved in this case.
*667 2. In the second assignment of error it is insisted that there was no evidence adduced at the trial to show a change in circumstances materially affecting the interest and welfare of the child. There was testimony given at the trial that since the original award of custody to the defendant, she had given birth to an illegitimate child, had gone out alone with a married man on several occasions and had hugged and kissed him, and had dated another married man. This was ample evidence from which the trial judge could conclude that there was a change in conditions substantially affecting the welfare of the child.
3. All but one of the remaining assignments of error are on the ground that the court erred in refusing to exclude the testimony of certain witnesses. The allegations of the petition were that the defendant had engaged in immoral conduct and had given birth to an illegitimate child. Testimony was allowed as to the illegitimacy of the child. The court also allowed cross examination "to establish a relationship [of the defendant with married men] up to the point of association, but not up to the point of adultery." Testimony as to the father of the child was ruled out. The controversy centers around the scope and meaning of Code § 38-1603 and Code Ann. § 38-1606 (Ga. L. 1951, pp. 596, 597). Code § 38-1603 provides: "No person offered as a witness shall be excluded by reason of incapacity, for crime or interest or from being a party, from giving evidence..." Code Ann. § 38-1606 provides: "Nothing contained in section 38-1603 shall apply to any action, suit, or proceeding in any court, instituted in consequence of adultery."
(a) It is urged that the plaintiff and defendant were wholly incompetent to testify because they were parties to a proceeding instituted in consequence of adultery. In Arnold v. Arnold, 141 Ga. 158 (3) (80 SE 652) and Evitt v. Evitt, 160 Ga. 497 (8) (128 SE 661) it was held that the Code sections rendering parties wholly incompetent to testify in an action instituted in consequence of adultery apply only when adultery is the sole basis of the action. The case at bar for a change of custody was brought on the grounds of a change in conditions materially affecting the welfare of the child. Adultery was one of the facts alleged in the petition to show a change in conditions, but it was *668 also alleged in the petition that the defendant had not given proper care and attention to the child and had engaged in immoral conduct. Thus it is seen that while the alleged adultery was one of the grounds on which the action was instituted, it was not the sole basis for the action and, following the rule stated above, the plaintiff and defendant were not wholly incompetent to testify.
(b) In the next ground it is urged that Kenneth Anderson, an alleged party to the adultery and a witness in the case, was wholly incompetent to testify and that the court erred in allowing him to testify. The fallacy in this contention is that the Code sections leaving persons wholly incompetent to testify do not apply to Kenneth Anderson because he is not a party to the case, but instead is a witness. The rule applies only to parties. See Peacon v. Peacon, 197 Ga. 748, 753 (30 SE2d 640). Moreover, following our holding above in 3 (a), Anderson would not have been wholly incompetent to testify if he had been a party since the instant proceeding was not instituted solely in consequence of adultery.
(c) In the next ground, error is assigned because the court allowed the defendant to testify as to whether she dated Kenneth Anderson. This testimony did not involve the question of adultery. It merely showed that the defendant had associated with married men. The court properly admitted the testimony into evidence.
4. In the last assignment of error it is urged that the court erroneously instructed Kenneth Anderson, a witness in the case, on his right to refuse to answer questions which might tend to incriminate him. The court instructed Anderson as follows: "If at any time there's any question as to whether or not you should answer a question as possible tending to incriminate you or as holding you up for public contempt, for public ridicule, you may have a right to refuse to answer it. If there's any question you may inquire of the court, I'll rule on them as we come to the questions and answers." We find no error in this instruction. It gave the witness fair and adequate notice of his privilege against self-incrimination. See division 2 of Davis v. State, 122 Ga. 564 (50 SE 376) and Code § 38-1205.
*669 All of the defendant's assignments of error are without merit.
Judgment affirmed. All the Justices concur.

ON MOTION FOR REHEARING.
ALMAND, Justice. Counsel for the plaintiff in error renews his contention that at the time this case was transferred from the superior court to the juvenile court it was not a divorce or habeas corpus case "involving the custody of a child." The undisputed facts in the record disclose that the bill of exceptions recites that the petition filed by the defendant in error in the superior court was one seeking the change of custody in the nature of a habeas corpus proceeding; that after the transfer of the case, the Judge of the Juvenile Court of Bibb County granted temporary custody of the child to the plaintiff in error; that she filed her cross action in the juvenile court seeking custody of the child; that not until she filed her bill of exceptions seeking a review of the judgment awarding the custody to the father did she claim the juvenile court was without jurisdiction. In a court having jurisdiction of the subject matter of an action the defendant may waive some privilege he has which exempts him from the jurisdiction of the court. Bostwick v. Perkins, Hopkins & White, 4 Ga. 47. Thus, when the defendant voluntarily appears in a court which has jurisdiction of the subject matter involved in the suit and makes defense, it is too late to question the jurisdiction after verdict. Southern Express Co. v. B. R. Electric Co., 126 Ga. 472 (55 SE 254). "Objections to lack of jurisdiction of the person, and other objections to jurisdiction not based on the contention that there is an absolute want of jurisdiction of the subject matter, are waived by invoking the court's jurisdiction, as by a cross bill or counterclaim." 21 CJS § 109.
The ruling in this case is not contrary to the decision of this court in West v. Hatcher, 219 Ga. 540 (134 SE2d 603). In that case the grandmother of certain named children, in her petition filed in the superior court and transferred to the juvenile court, sought the appointment of a legal custodian of the person and property of the minor children. In the juvenile court, the defendant, the mother, obtained a dismissal of the petition on her demurrers. As held by this court, the matter embraced in the *670 petition was not one of which the juvenile court was given jurisdiction on transferral.
Motion for rehearing denied. All the Justices concur.
