[U]What I’m trying to do
There are some options in the drop down menu. When I select an option, that selection should output the content of those <div name=[B]option
[code=html]
<html>
<head>
<title>Current News</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<style>
</style>
<script type=”text/javascript”>
function processGroup() {
var grouplist = document.getElementById(“grouplist”);
var optlist = grouplist.options[grouplist.selectedIndex].text;
var namelist = document.getElementsByName(optlist);
var headlines = “”;
var nl = namelist.childNodes;
document.getElementById(“input1”).value=grouplist.options[grouplist.selectedIndex].text;
for(var i = namelist.length-1; i >= 0; i–) {
headlines += namelist[i].innerHTML + “<br>”;
}
document.getElementById(“output3”).innerHTML = headlines ;
}
</script>
</head>
<body onload=”” marginheight=”30″ marginwidth=”30″ leftmargin=”30″ topmargin=”30″>
<form action=”index.html”>
<select id=”grouplist” onchange=”processGroup()”>
<option value=”Economics”>Economics</option>
<option value=”Health”>Health</option>
</select>
<p>Selected group is: <input type=”text” id=”input1″ size=”20″></p>
</form>
<div id=”output3″></div>
<br><br>
<div name=”Economics”>
• <a href=”mc.html”>Econ link 1</a>
</div>
<div name=”Economics”>
• <a href=”ab.html”>Econ link 2</a>
</div>
<div name=”Economics”>
• <a href=”gb.html”>Econ link 3</a>
</div>
<div name=”Health”>
• <a href=”ya.html”>Health link 1</a>
</div>
<div name=”Health”>
• <a href=”un.html”>Health link 2</a>
</div>
</div>
</body>
</html>