
28 Cal.App.2d 739 (1938)
L. A. FELS, Respondent,
v.
JUSTICE'S COURT OF THE CITY OF BERKELEY et al., Appellants.
Civ. No. 10472. 
California Court of Appeals. First Appellate District, Division One.  
October 21, 1938.
 Fred C. Hutchinson, City Attorney, and John D. Phillips, Assistant City Attorney, for Appellants.
 Gladstein & Grossman for Respondent.
 Jerome R. Hellerstein, Nathan Greene, Carol King, Arthur Garfield Hays, Osmund K. Fraenkel and A. L. Wiren, as Amici Curiae, on Behalf of Respondent.
 The Court.
 The plaintiff herein, L. A. Fels, was charged by a complaint filed in the Justice's Court of the City of Berkeley with having committed a misdemeanor, to wit, violation of an ordinance of that city. He was admitted to bail, entered a plea of not guilty, and moved for a dismissal of the charge. The motion was denied, and thereupon he instituted the present proceeding in the superior court for a writ of prohibition. The petition for the writ was based upon the ground that the justice's court was without jurisdiction to entertain or try the action for the following reasons, so plaintiff alleged: That the complaint failed to state a public offense, and that the portion of the ordinance which it is claimed was violated was unconstitutional. The proceeding terminated in the issuance of a writ permanently prohibiting the defendants, namely, the justice's court and the presiding justice of the peace thereof, from taking any further proceedings in the trial of said criminal action. An appeal was taken by said defendants, and it is presented on the judgment roll alone.
 [1] We are of the opinion that under well-established legal principles and the admitted facts of the case, the remedy *741 of prohibition was not available to plaintiff. As repeatedly held, the sole province of a writ of prohibition is to arrest proceedings of a tribunal or persons exercising judicial functions when without or in excess of jurisdiction. In other words, one of the prerequisites to the issuance of such a writ is that the tribunal or person against whom the writ is sought is acting without or in excess of jurisdiction; and the main test of jurisdiction is whether such tribunal or person is authorized by law to hear and determined the proceeding before it. (21 Cal.Jur. 583; Code Civ. Proc., sec. 1102.)
 [2] Moreover, it is well settled that the authority so to hear and determine involves the power to decide incorrectly, as well as correctly, in a given case or controversy within that jurisdiction, and does not depend upon the regularity of the exercise of that power or upon the rightfulness of the decision there made; that is to say, such writ is never employed as a means of correcting errors of inferior courts even though objection thereto is based on jurisdictional grounds. (21 Cal.Jur. 580, 584; 7 Cal.Jur. 590, and cases cited thereunder.) In this connection it has been expressly held that if an order made as an incident to the progress of a case involves the question of jurisdiction, prohibition cannot be invoked to annul the order or stop proceedings under it. (County of Sutter v. Superior Court, 188 Cal. 292 [204 P. 849]; Lumas Film Corp. v. Superior Court, 89 Cal.App. 384 [264 P. 792].) If the rule were otherwise, say the courts, then in every ordinary action whenever a defendant chose a point of jurisdiction, either of the person or of the subject-matter, he could by prohibition stop the ordinary progress of the action toward a judgment until a reviewing court passed upon the intermediate question, and thus such reviewing court would in innumerable cases be converted from an appellate to a nisi prius court. (Agassiz v. Superior Court, 90 Cal. 101 [27 P. 49]; Downs v. Municipal Court, 4 Cal.App.2d 88 [40 PaCal.2d 541].) [3] Accordingly in criminal proceedings it is held that if the tribunal has acquired jurisdiction of the subject-matter and the person of the defendant, its jurisdiction to hear and determine the proceeding is complete; moreover, that jurisdiction over the subject-matter of the offense charged is not to be determined by the nature of the procedure by which it is prosecuted, but by the *742 nature of the offense itself; and that consequently when the complaint which as filed attempts to set forth an offense of which the court has jurisdiction, the court has the power to determine the legal sufficiency of the complaint and that an erroneous determination does not deprive it of jurisdiction so as to furnish a basis for a writ of prohibition. (7 Cal.Jur. 897, and cases cited.)
 [4] Here admittedly the Justice's Court of the City of Berkeley has jurisdiction over criminal actions involving the alleged violations of ordinances of that city where, as here, it is charged that such violations are committed within the municipal boundaries of the city. Manifestly, therefore, the defendant justice's court and the presiding justice of the peace thereof had complete jurisdiction to proceed with the trial of the action then before it, regardless of the propriety of the ruling on the points involved in plaintiff's motion to dismiss.
 Plaintiff has cited but one case on this point, In re Kelso, 147 Cal. 609 [82 P. 241, 109 Am.St.Rep. 178, 2 L. R. A (N. S.) 796], contending that it holds that a "court which is about to proceed with the trial of a criminal action based upon a municipal ordinance which is invalid, acts in excess of its jurisdiction". An inspection of that case will show, however, that it was not so held. There the aggrieved party was charged with a violation of a municipal ordinance, and after a trial was convicted and sentenced; whereupon he applied for and obtained a writ of habeas corpus from the Supreme Court, and it was simply held that the ordinance being invalid the petitioner was entitled to his discharge. There is nothing in the decision which may be construed as holding that because the ordinance was invalid, the tribunal in which the petitioner was accused acted without or in excess of its jurisdiction in proceeding with the trial of the action.
 [5] Secondly, and in any event, it is admittedly the law of this state that authority to issue writs of prohibition is restricted to cases where there is no plain, speedy or adequate remedy at law. It is so declared by both legislative enactment and judicial decisions (Code Civ. Proc., sec. 1103; 21 Cal.Jur. 584); and here plaintiff was provided with two such remedies; namely, by way of appeal to the superior *743 court, in case of his conviction; and by way of habeas corpus, either before or after trial and conviction.
 As to the question of the completeness of the remedy by appeal, the case of Strouse v. Police Court, 85 Cal. 49 [24 P. 747], is directly in point. There, as here, the aggrieved party was charged in the police court with having violated a municipal ordinance which he claimed was unconstitutional; and after entering a plea of not guilty and challenging the jurisdiction of the court, he sought a writ of prohibition to restrain the police court from proceeding with the trial; and the writ was denied upon the ground that his remedy by appeal in case of his conviction was plain, speedy and adequate. So far as our attention has been called, there has never been any overruling of that case nor any departure from the principle therein declared; and among other cases which may be cited to the same effect are Powelson v. Lockwood, 82 Cal. 613 [23 P. 143]; Hamberger v. Police Court, 12 Cal.App. 153 [106 P. 894, 107 P. 614]; Simpson v. Police Court, 160 Cal. 530 [117 P. 553]; Germain Seed & Plant Co. v. Justice's Court, 41 Cal.App. 397 [182 P. 784]; Leach v. Superior Court, 215 Cal. 531, 534 [12 PaCal.2d 1].
 And as to the remedy of habeas corpus being a plain, speedy and adequate remedy in the ordinary course of law, the cases of Leach v. Superior Court, supra, Downs v. Municipal Court, supra, Keith v. Recorder's Court, 9 Cal.App. 380 [99 P. 416], and Cassidy v. Cannon, 18 Cal.App. 426 [123 P. 358], are decisive. As said by the Supreme Court in Leach v. Superior Court, supra, "The fact that the petitioner has this remedy by habeas corpus is a complete answer to his petition for a writ of prohibition. The latter writ is issued only 'where there is not a plain, speedy and adequate remedy in the ordinary course of law' (Code Civ. Proc., sec. 1103). The writ of habeas corpus is a remedy provided by law and there can be no question but that it meets the requirements of the section in being 'plain, speedy and adequate'. Upon this ground, as well as those stated in the previous portions of this opinion, petitioner's application for a writ of prohibition is denied."
 Plaintiff has cited several cases wherein writs of prohibition were issued; but an analysis of those cases demonstrates that none is here controlling. In the first three, Terrill v. *744 Superior Court, 6 Cal. Unrep. 398 [60 P. 38], Antilla v. Justice's Court, 209 Cal. 621 [290 P. 43], and Arfsten v. Superior Court, 20 Cal.App. 269 [128 P. 949], the writs were issued upon the ground that the tribunals which were there restrained were entirely without jurisdiction to entertain the proceedings then before them. As already pointed out, that is not the situation here. That is to say, in the Terrill case it was clearly shown that the trial court was without jurisdiction to proceed further with the case because the grand jury which returned the indictment upon which the accused was tried and convicted was wholly without legal authority to return the indictment; in the Antilla case the accused was charged with a criminal offense in one judicial township, whereas it affirmatively appeared that the alleged offense was committed in another; and in the Arfsten case a county by ordinance attempted to confer trial jurisdiction on the superior court for infractions of a certain ordinance, whereas the Penal Code fixed the maximum penalty for the same offense at a less amount so as to make it cognizable only in the justice's court. It was held, therefore, that the superior court was without jurisdiction to proceed with the trial. As to the fourth case, Fueller v. Justice's Court, 134 Cal.App. 305 [25 PaCal.2d 248], it was held that a writ of prohibition was available to the accused for the reason that as the result of certain proceedings had after conviction in the trial court he was deprived of his right of appeal. In the remaining case cited by plaintiff, Treppa v. Justice's Court, 1 Cal.App.2d 374 [36 PaCal.2d 819], the application for the writ was based upon the ground that the criminal complaint filed in the justice's court did not state a public offense. The answer made thereto by the defendants therein was that if the justice's court had erroneously ruled otherwise, petitioner's remedy was by way of appeal. It was held, however, that "inasmuch ... as the only right of a defendant in the justice's court, according to section 1429 of the Penal Code, is to enter a plea of guilty or not guilty, it is apparent petitioner has no opportunity to challenge the sufficiency of the complaint prior to trial and the remedy (of appeal) is not, under these circumstances, adequate". And as authority for the ruling and in support thereof, the court quotes certain language from Ex parte Hayter, 16 Cal.App. *745 211 [116 P. 370]. But in so doing it seems to have overlooked the fact that Ex parte Hayter, supra, was a proceeding in habeas corpus, and not one in prohibition; and that the language quoted was directed to the point that notwithstanding that the petitioner therein had a remedy by appeal, he was nevertheless entitled to invoke the speedier remedy of habeas corpus. Moreover, in the later case of Downs v. Municipal Court, supra, a situation identical with that of the Treppa case came before the court on petition for a writ of prohibition, and the court declined to follow the decision in the Treppa case and denied the writ. In doing so the court in part said: "... petitioner contends that since section 1429 of the Penal Code does not provide for the testing of the sufficiency of a complaint in a municipal court by demurrer where such a complaint does not state a public offense, such courts under such circumstance may be restrained by prohibition. To support this contention petitioner relies mainly upon the case of Treppa v. Justice's Court, 1 Cal.App.2d 374 [36 PaCal.2d 819]. The case furnishes some ground for this contention. However, an examination of the cases will show that this case runs counter to the greater weight of authority. (Citing numerous authorities.) The Treppa case entirely overlooks the right of petitioner therein to move in arrest of judgment at any time before judgment is entered and his right to a writ of habeas corpus after judgment. It decides the case upon the theory that petitioner's only remedy in the ordinary course of law is by appeal. Furthermore, to adopt the rule in the Treppa case, supra, would be against good public policy. If the rule were adopted as contended for by petitioner it would result in providing a procedure whereby in effect demurrers in criminal cases in municipal courts would be transferred to and heard by the District Court of Appeal. This would be impracticable, for in that event the time and energy of the District Court of Appeal would be largely taken up in acting as a law and motion department of the municipal courts."
 In view of the conclusion reached on this branch of the case it becomes unnecessary to inquire into the question of the constitutionality of the ordinance. The judgment appealed from is reversed with directions to enter a new judgment in favor of the defendants. *746
