A defendant may obtain an injunction upon an answer, in the nature of a counterclaim. He shall proceed in the manner hereinbefore prescribed.
R.L. 1910, § 4880.