I have this script and I would like to set the initial value of a variable that the script can later set with a drop down but, can;t figure it out. I'm sure it will take one if you a few seconds!
Code:
javascript:(function()
{
var previousInnerHTML = new String();
window.onload = function() {
previousInnerHTML = document.getElementById('goal_header_outer_wrapper').innerHTML;
previousInnerHTML = previousInnerHTML.concat("<div align=\"center\"><br>");
previousInnerHTML = previousInnerHTML.concat("<form style=\"display: inline\">");
previousInnerHTML = previousInnerHTML.concat("<SELECT name=\"numberconsumables\" onchange=\"ConsumableNUM = this.options[selectedIndex].value; alert ('You will be using ' + ConsumableNUM + ' consumables when you click the Snack Bar butons')\">");
previousInnerHTML = previousInnerHTML.concat("<OPTION selected value=\"1\">1</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"2\">2</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"3\">3</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"4\">4</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"5\">5</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"6\">6</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"7\">7</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"8\">8</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"9\">9</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"10\">10</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"11\">11</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"12\">12</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"13\">13</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"14\">14</OPTION>");
previousInnerHTML = previousInnerHTML.concat("<OPTION value=\"15\">15</OPTION>");
previousInnerHTML = previousInnerHTML.concat("</SELECT>");
previousInnerHTML = previousInnerHTML.concat("</form>");
previousInnerHTML = previousInnerHTML.concat("<form style=\"display: inline\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Energy Drink\" onclick=\"ACTIONS.use_consumable(1,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Energy Infusion\" onclick=\"ACTIONS.use_consumable(5,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Atomic Energizer\" onclick=\"ACTIONS.use_consumable(9,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Nucleic Reactor\" onclick=\"ACTIONS.use_consumable(11,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Red Line\" onclick=\"ACTIONS.use_consumable(234,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Adrenaline Pill\" onclick=\"ACTIONS.use_consumable(13,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Adrenaline Injector\" onclick=\"ACTIONS.use_consumable(15,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("<input type=\"button\" class=\"btnFJ\" value=\"Stamina Serum\" onclick=\"ACTIONS.use_consumable(236,ConsumableNUM)\">");
previousInnerHTML = previousInnerHTML.concat("</form>");
previousInnerHTML = previousInnerHTML.concat("</div>");
document.getElementById('goal_header_outer_wrapper').innerHTML = previousInnerHTML;
};
}
)();