Judgment may be had, if the defendant fails to answer the complaint, as follows:
(a)
In an action arising upon contract or judgment for the recovery of money or damages only, if the defendant has, or if more than one defendant, if any of the defendants have, been served, other than by publication, and no answer, demurrer, notice of motion to strike of the character specified in subdivision (f), notice of motion to transfer pursuant to Section 396b, notice of motion to dismiss pursuant to Article 2 (commencing with Section 583.210) of Chapter 1.5 of Title 8, notice of motion to quash service of summons or to stay or dismiss the action pursuant to Section 418.10, or notice of the filing of a petition for writ of mandate as provided in Section 418.10 has been filed with the clerk of the court within the time specified in the summons, or within further time as may be allowed, the clerk, upon written application of the plaintiff, and proof of the service of summons, shall enter the default of the defendant or defendants, so served, and immediately thereafter enter judgment for the principal amount demanded in the complaint, in the statement required by Section 425.11, or in the statement provided for in Section 425.115, or a lesser amount if credit has been acknowledged, together with interest allowed by law or in accordance with the terms of the contract, and the costs against the defendant, or defendants, or against one or more of the defendants. If, by rule of court, a schedule of attorneys’ fees to be allowed has been adopted, the clerk may include in the judgment attorneys’ fees in accordance with the schedule (1) if the contract provides that attorneys’ fees shall be allowed in the event of an action thereon, or (2) if the action is one in which the plaintiff is entitled by statute to recover attorneys’ fees in addition to money or damages. The plaintiff shall file a written request at the time of application for entry of the default of the defendant or defendants, to have attorneys’ fees fixed by the court, whereupon, after the entry of the default, the court shall hear the application for determination of the attorneys’ fees and shall render judgment for the attorneys’ fees and for the other relief demanded in the complaint, in the statement required by Section 425.11, or in the statement provided for in Section 425.115, or a lesser amount if credit has been acknowledged, and the costs against the defendant, or defendants, or against one or more of the defendants.
(b)
In other actions, if the defendant has been served, other than by publication, and no answer, demurrer, notice of motion to strike of the character specified in subdivision (f), notice of motion to transfer pursuant to Section 396b, notice of motion to dismiss pursuant to Article 2 (commencing with Section 583.210) of Chapter 1.5 of Title 8, notice of motion to quash service of summons or to stay or dismiss the action pursuant to Section 418.10 or notice of the filing of a petition for writ of mandate as provided in Section 418.10 has been filed with the clerk of the court within the time specified in the summons, or within further time as may be allowed, the clerk, upon written application of the plaintiff, shall enter the default of the defendant. The plaintiff thereafter may apply to the court for the relief demanded in the complaint. The court shall hear the evidence offered by the plaintiff, and shall render judgment in the plaintiff’s favor for that relief, not exceeding the amount stated in the complaint, in the statement required by Section 425.11, or in the statement provided for by Section 425.115, as appears by the evidence to be just. If the taking of an account, or the proof of any fact, is necessary to enable the court to give judgment or to carry the judgment into effect, the court may take the account or hear the proof, or may, in its discretion, order a reference for that purpose. If the action is for the recovery of damages, in whole or in part, the court may order the damages to be assessed by a jury; or if, to determine the amount of damages, the examination of a long account is involved, by a reference as above provided.
(c)
In all actions where the service of the summons was by publication, upon the expiration of the time for answering, and upon proof of the publication and that no answer, demurrer, notice of motion to strike of the character specified in subdivision (f), notice of motion to transfer pursuant to Section 396b, notice of motion to dismiss pursuant to Article 2 (commencing with Section 583.210) of Chapter 1.5 of Title 8, notice of motion to quash service of summons or to stay or dismiss the action pursuant to Section 418.10, or notice of the filing of a petition for writ of mandate as provided in Section 418.10 has been filed, the clerk, upon written application of the plaintiff, shall enter the default of the defendant. The plaintiff thereafter may apply to the court for the relief demanded in the complaint; and the court shall hear the evidence offered by the plaintiff, and shall render judgment in the plaintiff’s favor for that relief, not exceeding the amount stated in the complaint, in the statement required by Section 425.11, or in the statement provided for in Section 425.115, as appears by the evidence to be just. If the defendant is not a resident of the state, the court shall require the plaintiff, or the plaintiff’s agent, to be examined, on oath, respecting any payments that have been made to the plaintiff, or to anyone for the plaintiff’s use, on account of any demand mentioned in the complaint, in the statement required by Section 425.11, or in the statement provided for in Section 425.115, and may render judgment for the amount that the plaintiff is entitled to recover. In all cases affecting the title to or possession of real property, where the service of the summons was by publication and the defendant has failed to answer, no judgment shall be rendered upon proof of mere occupancy, unless the occupancy has continued for the time and has been of the character necessary to confer title by prescription. In all cases where the plaintiff bases a claim upon a paper title, the court shall require evidence establishing the plaintiff’s equitable right to judgment before rendering judgment. In actions involving only the possession of real property where the complaint is verified and shows by proper allegations that no party to the action claims title to the real property involved, either by prescription, accession, transfer, will, or succession, but only the possession thereof, the court may render judgment upon proof of occupancy by plaintiff and ouster by defendant.
(d)
In the cases referred to in subdivisions (b) and (c), or upon an application to have attorneys’ fees fixed by the court pursuant to subdivision (a), the court in its discretion may permit the use of affidavits, in lieu of personal testimony, as to all or any part of the evidence or proof required or permitted to be offered, received, or heard in those cases. The facts stated in the affidavit or affidavits shall be within the personal knowledge of the affiant and shall be set forth with particularity, and each affidavit shall show affirmatively that the affiant, if sworn as a witness, can testify competently thereto.
(e)
If a defendant files a cross-complaint against another defendant or the plaintiff, a default may be entered against that party on that cross-complaint if the plaintiff or that cross-defendant has been served with that cross-complaint and has failed to file an answer, demurrer, notice of motion to strike of the character specified in subdivision (f), notice of motion to transfer pursuant to Section 396b, notice of motion to dismiss pursuant to Article 2 (commencing with Section 583.210) of Chapter 1.5 of Title 8, notice of motion to quash service of summons or to stay or dismiss the action pursuant to Section 418.10, or notice of the filing of a petition for a writ of mandate as provided in Section 418.10 within the time specified in the summons, or within another time period as may be allowed. However, no judgment may separately be entered on that cross-complaint unless a separate judgment may, in fact, be properly awarded on that cross-complaint and the court finds that a separate judgment on that cross-complaint would not substantially delay the final disposition of the action between the parties.
(f)
A notice of motion to strike within the meaning of this section is a notice of motion to strike the whole or any part of a pleading filed within the time which the moving party is required otherwise to plead to that pleading. The notice of motion to strike shall specify a hearing date set in accordance with Section 1005. The filing of a notice of motion does not extend the time within which to demur.