
964 S.W.2d 784 (1998)
Michelle Smith YOUNG, Appellant,
v.
Rodney SMITH, Appellee.
No. 97-574.
Supreme Court of Arkansas.
February 19, 1998.
James Dunham, Russellvile, for appellant.
Winston Bryant, Atty. Gen., Brad Newman, Asst. Atty. Gen., Little Rock, for appellee.
THORNTON, Justice.
The issue in this a case is whether a chancery court has the power to enforce its order awarding visitation to a stepparent in the context of a divorce decree. Appellee Rodney Smith filed a complaint for divorce from appellant Michelle Smith Young on May 6, 1992, in the Randolph County Chancery *785 Court. In his complaint, appellee requested custody of Dustin, the child whom he regarded as his own although Dustin was born prior to the parties' marriage. In her answer, appellant denied that appellee was the child's biological father and protested any custody or visitation award. The chancellor ordered a paternity test, which proved that Dustin was not appellee's biological child. The chancery court entered the divorce decree on December 23, 1992. In its decree, the court granted the parties an absolute divorce, noted that appellee was not Dustin's biological father, granted appellant custody of Dustin, awarded appellee the right to visitation, and awarded appellant child support. We note that appellant elected not to appeal from the chancery court's divorce decree granting the visitation rights.
Appellant brings this appeal from the September 9, 1996 order of the chancery court, finding her in contempt. In the contempt order, the chancery court found that appellant had wilfully violated its prior visitation orders and been held in contempt for refusing to comply with those orders, and sentenced appellant to serve thirty days in the Randolph County Detention Center. The chancery court also required appellant to place a $5,000 bond with the chancery clerk to secure future compliance with the court's orders. On appeal, appellant argues (1) that the chancery court erred by enforcing its visitation orders that granted appellee visitation rights with Dustin, and (2) that the divorce decree and other orders of the chancery court that granted appellee visitation rights are void because the chancery court lacked subject-matter jurisdiction. This appeal has been certified to this court from the court of appeals.
Appellant has also filed a petition for writ of prohibition to enjoin both the orders of the chancery court finding her in contempt and the decision of our court of appeals affirming a February 9, 1996 contempt order. In her petition, appellant argues that the visitation orders issued by the chancery court and affirmed by the court of appeals exceeded the chancery court's jurisdiction and are therefore void and unenforceable. Appellant also argues that the court of appeals' affirmance was an illegal expansion of the chancery court's jurisdiction.
The principal issue presented for decision in both the appeal and the petition is whether the chancery court exceeded its power, and thereby its subject-matter jurisdiction, in granting visitation rights to a stepparent. Procedurally, appellant's remedy for a review of a contempt order is appeal. Frolic Footwear v. State, 284 Ark. 487, 683 S.W.2d 611 (1985); Hickinbotham v. Williams, Chancellor, 227 Ark. 126, 296 S.W.2d 897 (1956). Moreover, the purpose of the writ of prohibition is to prevent a court from exercising a power not authorized by law when there is no adequate remedy by appeal or otherwise. Tatro v. Langston, 328 Ark. 548, 944 S.W.2d 118 (1997). It is well settled that a writ of prohibition is an extraordinary writ that is appropriate only when the lower court is wholly without jurisdiction. Nucor Holding Corp. v. Rinkines, 326 Ark. 217, 222, 931 S.W.2d 426, 429 (1996). We have stated that a writ of prohibition is never issued to prohibit an inferior court from erroneously exercising its jurisdiction. Dougan v. Gray, 318 Ark. 6, 17, 884 S.W.2d 239, 242 (1994). In the case before us, writof-prohibition relief is not available because appellant's remedy is one of appeal from the trial court's contempt order.
This appeal and the appeal upon which the court of appeals acted arise from chancery-court orders finding appellant in contempt. Appellant argues that the chancery court lacked the authority to issue the contempt orders to enforce its visitation orders because the court lacked subject-matter jurisdiction to enter the visitation orders. We first consider whether the chancery court had jurisdiction to hear this case.
Although the divorce decree granting visitation is not before us, we address whether the lower court had subject-matter jurisdiction because lack of subject-matter jurisdiction is a defense that may be raised at any time by either a party or the court, and it is a defect that is never waived by a failure to raise it at a particular point in a proceeding. Ark. R. Civ. P. 12(h)(3). A court that acts without subject-matter jurisdiction or in excess of its power produces a result that is *786 void and cannot be enforced. West v. Belin, 314 Ark. 40, 45, 858 S.W.2d 97, 100 (1993).
This court has defined jurisdiction as "the power to hear and determine the subject-matter in controversy between the parties to the suit; to adjudicate or exercise any judicial power over them." Lamb & Rhodes v. Howton, 131 Ark. 211, 213, 198 S.W. 521, 522 (1917). The following language from the court of appeals is instructive on the issue before us:
The rule of almost universal application is that there is a distinction between want of jurisdiction to adjudicate a matter and a determination of whether the jurisdiction should be exercised. Jurisdiction of the subject matter is power lawfully conferred on a court to adjudge matters concerning the general question in controversy. It is power to act on the general cause of action alleged and to determine whether the particular facts call for the exercise of that power. Subject matter jurisdiction does not depend on a correct exercise of that power in any particular case. If the court errs in its decision or proceeds irregularly within its assigned jurisdiction, the remedy is by appeal or direct action in the erring court. If it was within the court's jurisdiction to act upon the subject matter, that action is binding until reversed or set aside.
Banning v. State, 22 Ark.App. 144, 149, 737 S.W.2d 167, 170 (1987) (citations omitted).
Here, if the issue is properly phrased as one of "subject-matter jurisdiction," our analysis is confined to whether the Randolph County Chancery Court possessed the power to adjudge and act on the general cause of action alleged.
The underlying general cause of action in this case goes back to the decree of divorce, filed on December 23, 1992, in which the chancery court granted appellant custody of Dustin and granted appellee visitation rights. This case involves issues of divorce, child custody, paternity, child support, and visitation, each of which could properly be brought in the chancery court. See, e.g., McCormac v. McCormac, 304 Ark. 89, 799 S.W.2d 806 (1990) (stating that chancery courts have subject-matter jurisdiction to make custody, support, and visitation determinations); Quarles v. French, 272 Ark. 51, 611 S.W.2d 757 (1981) (noting that visitation rights are exclusively within the jurisdiction of the chancery courts); see also Stamps v. Rawlins, 297 Ark. 370, 761 S.W.2d 933 (1988) (stating that a chancery court may award custody of a child to a stepparent, although we held that it was not in the best interest of the child do so under the facts of that case). All of these issues were addressed in the chancellor's original order, and they are squarely within the equity jurisdiction that the legislature conferred on chancery courts in this state. See Ark.Code Ann. § 16-13-304 (Supp.1997). We conclude that the Randolph County Chancery Court had jurisdiction over the subject-matter of this case.
Having determined that the chancery court had subject-matter jurisdiction to enter the visitation orders, we next consider appellant's argument that the chancery court erred in enforcing its visitation orders. Chancery courts clearly have the authority to issue or deny injunctive relief and other equitable relief. West v. Belin, 314 Ark. at 44, 858 S.W.2d at 101. The right to punish for contempt is inherent in all courts. Dougan v. Gray, 318 Ark. at 17, 884 S.W.2d at 245. Here, the contempt orders from which appellant appeals were the chancery court's attempt to enjoin appellant from violating its orders relating to appellee's visitation rights.
Where an appellant claims error in a court's decision, the appropriate procedure is to obey the order and pursue a remedy by appeal or direct action in the erring court, rather than through an appeal from the order finding the appellant in contempt for its violation. See Casey v. Self, 236 Ark. 496, 367 S.W.2d 114 (1963). We have held that a party who violated an order of injunction could not test the validity of the original order upon which the injunction was based only after being found in contempt for its violation. Carnes v. Butt, 215 Ark. 549, 551, 221 S.W.2d 416, 417 (1949). This case law clearly requires that appellant's remedy lies either through a timely appeal from the original divorce decree, which she claims erroneously granted appellee visitation, or through *787 direct action to petition the chancery court to modify the decree, based on changed circumstances, if any, relating to the welfare of the child.
Where, as here, the chancery court acted upon a subject matter within its jurisdiction, we maintain that the action is binding until it is reversed or set aside. We therefore affirm the chancery court's decision and dismiss this appeal without prejudice to appellant's right to seek to modify the issue of visitation through direct action in the chancery court.
Affirmed.
GLAZE and CORBIN, JJ., concur.
GLAZE, Justice, concurring.
I join the majority, but write to address only the subject-matter jurisdiction issue, since I agree entirely with the majority's procedural holding that writ of prohibition is not the vehicle for review of this cause. The majority court also correctly holds that the chancery court had subject-matter jurisdiction in granting appellant-stepparent Rodney Smith visitation, but I concur to offer further support for that conclusion.
Michelle Young is correct that Smith has no statutory right under which he can demand visitation with Dustin. Even so, visitation privileges may be extended to nonadoptive stepparents who have stood in loco parentis to the child. See 27C C.J.S. Divorce § 632 (1986); see also Golden v. Golden, 57 Ark.App. 143, 942 S.W.2d 282 (1997), citing Riddle v. Riddle, 28 Ark.App. 344, 775 S.W.2d 513 (1989); contra 27C C.J.S. § 632 (Cum.1997).
Concerning the Golden and Riddle cases, Young makes a strong argument that those cases fail to support the proposition that a stepparent is entitled to visitation with a stepchild. I agree. Riddle never decided the issue, and Golden simply mischaracterized the Riddle holding. Nevertheless, our court, in Stamps v. Rawlins, 297 Ark. 370, 761 S.W.2d 933 (1988), did address the issue as to whether a chancery court can award custody of a child to a stepparent, and held a chancellor may do so. The Stamps court did so even though Arkansas's statute makes no reference to a stepparent, but instead reads, "... [T]he award of custody of the children of the marriage shall be made without regard to the sex of the parent, but solely in accordance with the welfare and best interests of the children."[1]
Given the rule that a stepparent may be awarded custody of a stepchild if the child's welfare and best interest warrant such placement, I submit that a stepparent standing in loco parentis may be awarded visitation rights. See also Jeff Atkinson, Modern Child Custody Practice § 8.18 (1986 and Cum.1987) (case law from at least nine states has recognized a right of stepparents to seek visitation); see also Koelle v. Zwiren, 284 Ill.App.3d 778, 220 Ill.Dec. 51, 672 N.E.2d 868 (1 Dist.1996) (awarding custody or visitation rights to nonparent over objection of natural parent is permissible if it would be in best interests of child).
In conclusion, I note Young's reliance on two earlier cases of this court, Poe v. Case, 263 Ark. 488, 565 S.W.2d 612 (1978), and Wilson v. Wallace, 274 Ark. 48, 622 S.W.2d 164 (1981), that dealt with grandparent visitation rights. She suggests those holdings provide visitation orders that lack statutory authority and are void and unenforceable. I disagree. Poe merely holds that probate court is a court of special and limited jurisdiction and a probate court decree attempting to grant visitation rights to a natural grandparent as an incident to an adoption, or to enforce a grandparent's visitation rights without specific statutory authority, is surplusage and void. And the Wilson case, a chancery court case, involved whether paternal grandparents were entitled to visitation rights after the widowed mother remarries and the second husband adopts her child. The Wilson court said no, but it denied visitation based upon the legislature having enacted law that "terminated all legal relationships between the adopted individual and his relatives ... so the adopted individual thereafter *788 is a stranger to his former relatives for all purposes." Here, the Arkansas General Assembly has enacted no law that proscribes stepparents, standing in loco parentis, from visiting with a stepchild. In sum, I find the cases Young cites inapplicable to the situation now before this court. I concur with the results reached by the majority.
CORBIN, J., joins this concurrence.
NOTES
[1]  In Stamps, the court awarded custody of the child in the mother because the mother was a fit and proper person for custody.
