CSS print style only on click print form

<a class="printthisonly" onclick="print();">

This way if only clicked on print a tag

@media print
{
	body
	{
		display: none;
	}

	form
	{
		display: block;
	}
}

How to make above line print the only form if click on .printthisonly a tag? If not then use default print style at CSS?

Thanks.

body {visibility:hidden;}
.print {visibility:visible;}

This why print whole page? not understand