Hello I am trying to write the following code with and elements to display some options on the form using visual studio code editor. My code editor is not displaying the "options" property after dot operator in an array syntax, it is showing option. Here is the original code.
<html>
<head>
<title>DOM Tests</title>
<script>
function setBodyAttr(attar, value) {
if (document.body) document.body[attar] = value;
else throw new Error("no support");
}
</script>
</head>
<body>
<div style="margin: .5in; height: 400px;">
<form>
<p><b><code>text</code></b></p>
<select onChange="setBodyAttr('text',
this.options[this.selectedIndex].value);">
<option value="black">black</option>
<option value="red">red</option>
</select>
<small>
<a href="http://some.website.tld/page.html" id="sample">
(sample link)
</a>
</small><br />
<input type="button" value="version" onclick="ver()" />
</form>
</div>
</body>
</html>