var numi = document.getElementById('theValue'); var ni=document.getElementById('mydiv'); var num = (document.getElementById('theValue').value - 1) + 2; divname = ni; numi.value = num; var newdiv = document.createElement('div'); var divIdName = 'my' + num + 'Div'; //Calculating Major and Minor Count var majorcount = parseInt(document.getElementById('majorcount').value); newdiv.setAttribute('id', divIdName); if (ni.id == "addmajordiv") { var select = document.createElement('select'); select.setAttribute("name", document.getElementsByTagName('select')[j].name); select.setAttribute("style", "width: 350px;height:35px;"); var link=document.createElement('a'); link.setAttribute('onclick', 'removeElement(' + divIdName + ')'); link.setAttribute('style', 'font-size: 120%;font-weight: bold'); link.setAttribute('href', '#'); link.innerText = "Remove"; for (var i = 0; i < document.getElementById('all').length; i++) { var option = document.createElement("option"); option.text = document.getElementById('all')[i].text; option.value = document.getElementById('all')[i].value; try { select.add(option, null); //Standard select.id = "MajorCourse"; select.name = "MajorCourse"; } catch (error) { select.add(option); // IE only } } newdiv.appendChild(select); newdiv.appendChild(link); majorcount = majorcount + 1; document.getElementById('majorcount').value = majorcount; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)