Getting Exception parsing document error in for (var i = 0; i < Memoryval.length; i++) line.
Can anybody help?
Below is the code.
$(".rad").click(function () {
var Memoryval = ["Fixed"];
var CPU = ["Fixed", "Utilization", "OwnBorrow", "Custom", "Conditional"];
var sel = document.getElementById('ddltype');
sel.innerHTML = "";
if (this.value == "MEMORY") {
for (var i = 0; i < Memoryval.length; i++) {
var opt = document.createElement('option');
opt.innerHTML = Memoryval[i];
opt.value = Memoryval[i];
sel.appendChild(opt);
}
$("#divOwnBorrow").hide();
$("#divFixed").show();
$("#divUtilization").hide();
$("#spanid").show();
}
if (this.value == "CPU") {
for (var i = 0; i < CPU.length; i++) {
var opt = document.createElement('option');
opt.innerHTML = CPU[i];
opt.value = CPU[i];
sel.appendChild(opt);
}
$('#ddltype option[value=OwnBorrow]').prop('selected', true);
// $("#ddltype select").text("OwnBorrow");
$("#divOwnBorrow").show();
$("#divFixed").hide();
$("#divUtilization").hide();
$("#spanid").hide();
}
});