Skip to content

Instantly share code, notes, and snippets.

@meadhikari
Created February 8, 2012 10:14
Show Gist options
  • Save meadhikari/1767818 to your computer and use it in GitHub Desktop.
Save meadhikari/1767818 to your computer and use it in GitHub Desktop.
Javascript Novice Question
// this clearly is not the correct way of doing this, what must I be doing
pos1 = document.getElementById('pos1').value;
pos2 = document.getElementById('pos2').value;
pos3 = document.getElementById('pos3').value;
pos4 = document.getElementById('pos4').value;
pos5 = document.getElementById('pos5').value;
pos6 = document.getElementById('pos6').value;
pos7 = document.getElementById('pos7').value;
pos8 = document.getElementById('pos8').value;
pos9 = document.getElementById('pos9').value;
var elements=[pos1,pos2,pos3,pos4,pos5,pos6,pos7,pos8,pos9];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment