Home > Article > Web Front-end > Javascript operation html control instance (javascript adds html)_Basic knowledge
_showSchools: function (data) { //data represents a data object
var mySelect = document.getElementById("selectSchools"); // Get the drop-down box for (var index in data) {
var item = data[index];
var opp = new Option(item.SchoolName, item.name); //The first parameter represents the content displayed in the drop-down box, and the second one represents The content selected in the drop-down box
opp.name = "option" index;
mySelect.add(opp);
},
//Getting the content of the drop-down list
var schoolId = document.getElementById("selectSchools").value;
function on_idmbzd_change(){
var sel_obj=document.getElementById("idMbzd");
alert(sel_obj.options[index].value);
alert(sel_obj.options[index] .text);
}
//Getting the content of the radio button
var chkObjs = document.getElementsByName("radio");
var checkvalue = null;
}
//Radio button settings
if (entity.SelectType == 1) document.getElementById("SelectType").checked = true;
if (entity.SelectType == 0) document.getElementById ("UnSelectType").checked = true;
//Multiple check box settings
var courseList = document.getElementsByName("CourseList");
for (var i = 0; i < courseList. length - 1; i ) {
}
},