Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<select id="myID">
<option value="javascript">javascript</option>
<option value="jquery">jquery</option>
<option value="angularjs">angularjs</option>
<option value="react">react</option>
</select>
<script type="text/javascript">
function MyDelete() {
var o = document.getElementById("myID");
var opt = document.createElement('option');
opt.value = "backbonejs";
opt.innerHTML = "backbonejs";
for (var i = 0; i < o.options.length; i++) {
if (o.options[i].text == "backbonejs") {
o.remove(i);
var a = "removed";
break;
}
}
if (a != "removed") {
o.appendChild(opt);
}
}
</script>
</p><button type="button" onclick="MyDelete()">click</button>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507