TheConeHead
Programmer
How do I change the text in a div?
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
document.getElementById('myDiv').innerHtml = 'something or other';
<head>
function showDetail(trigger) {
document.getElementById('sevDetail').innerHtml = 'something or other';
}
</head>
<body>
<select name="severity" onchange="showDetail(this.value);">
<option value="">None Selected
<option value="1">1
<option value="2">2
<option value="3">3
</select>
<div id="sevDetail"></div>
</body>
document.getElementById('sevDetail').inner[COLOR=red]HTML[/color]="solved";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript"><!--
function showDetail(trigger) {
document.getElementById('sevDetail').innerHTML = trigger;
}
function getSelVal(sel) {
return sel.options[sel.selectedIndex].value;
}
//--></script>
</head>
<body>
<select name="severity" onchange="showDetail(getSelVal(this));">
<option value="">None Selected
<option value="1">1
<option value="2">2
<option value="3">3
</select>
<div id="sevDetail"></div>
</body>
</html>
I don't understand why... I've never experienced any problems doing this (and you are passing 'this' which is a superset of 'this.value'). Just curious, that's all....try not to use .value directly with a select box