   Game website JS question
  Hi my game website has a simple form on it that allows the users to choose between 4 radio buttons. When the user selects one of the buttons, I want a disabled section of the for to become enabled. The section consists of input and select tags only.Every input & select tag that is in this "disabled section" is assigned a class attribute with a value of "toggleSection". It would be nice to be able to use code like: document.getElementsByClass("toggleSection").enabled = true;However, I don't think JS support such a function; I'm only seeing getElementsById(), ...Name() or ...TagName(). What's the best approach here?   
  It's been ages since I've done some JS, but what exactly is the problem with using document.getElementById()?;  If you really want to get elements by class, use something this:document.getElementsByClass = function(cls) {var found = [];var rx = new RegExp('(^| )' + cls + '( |$)');var els = this.getElementsByTagName('*');for (var i=0; i<els.length; i++) {var elClass = els.className;if (rx.test(elClass)) {found.push(elClass);}}return found;};document.getElementByClass = function(cls) {var rx = new RegExp('(^| )' + cls + '( |$)');var els = this.getElementsByTagName('*');for (var i=0; i<els.length; i++) {var elClass = els.className;if (rx.test(elClass)) {return elClass;}}return 0;};If you don't have elems using multiple classes like this<div class="class1 class2">You can replace the regex with a simple string comparison   