I'm trying to take values from a from and then and when it is submitted turn the values into a cookies. This is what I have, but I wanted to know if there was a way to make it so I didn't have to keep writing out the same thing for all of the variables. 

```
function submitValues(){

var firstName = document.forms["frm1"]["first_name"].value;
var lastName  = document.forms["frm1"]["last_name"].value;
var number    = document.forms["frm1"]["phNum"].value;

setCookie("firstName",firstName,365);
setCookie("lastName",lastName,365);
setCookie("number",number,365);
}

```