Jurisdiction is the legal power and authority of a court to hear and determine an action or proceeding involving the legal relations of the parties, and to grant the relief to which they are entitled.