Why did Austria and Prussia declare war on Denmark?

Austria and Prussia declared war on Denmark to regain the provinces of Schleswig and Holstein, which were ruled by the Danish crown but were predominantly German-speaking.