Whing Dela Cruz
asked on
Html option caption
Hi, Experts, How to change the option caption using javascript? Base on my code, I want to change the option caption from "Yes" to "No". Thanks!
<!DOCTYPE html>
<html>
<body>
<button onclick="return ChangeCaption()">Change</button>
<select name="level" id="iAD8" style="color: black; width:50px;">
<option value="yes" selected>Yes</option>
<option value="no">No</option>
</select>
<script>
function ChangeCaption()
{
document.getElementById("iAD8").value = "No";
}
</script>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome, glad to help.
ASKER