title: JavaScript code for combining for loop, text, checkboxes, result
body: <p>I'm trying to complete an exercise for a JavaScript class and I'm confused about the order of code. The exercise is this: we are gathering survey information in a form. Instructions: use a for loop to find out which checkboxes are selected (user can select up to 4) and display their value in the result message. The choices for the checkboxes are red, blue, orange and purple.</p>
  
  <p>Any help anyone can offer would be most appreciated. This is my first question on stackOverflow so begging pardon if I have not adhered to all the guidelines. Thank you!</p>