Getting form elements with jQuery

I am getting form names & values using the following. How can I write the following using jQuery?

var options = '';
for (i = 0; i < document.formname.elements.length; i++) {
	var optionName = document.formname.elements[i].name;
	var optionValue = document.formname.elements[i].value;
	options += optionName+optionValue;

There is no practical purpose, just want to know if it is possible to write the following statements in jQuery.


Thanks for any ideas.