Forum Moderators: open
try this, it may suit your requirements...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>radio button swap text</title><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[function fillSpan(n,m,words) {
if(document.forms[0][n].checked==true) {
document.forms[0][n].checked=false;
document.forms[0][m].checked=true;
}
document.getElementById("word").innerHTML=words;
}//]]>
</script></head>
<body><form action="#">
<div>
<label>
<input type="radio" checked="checked" value="a correct" onclick="fillSpan(1,0,this.value)"/>
: correct</label>
</div>
<div>
<label>
<input type="radio" value="an incorrect" onclick="fillSpan(0,1,this.value)"/>
: incorrect</label>
</div>
</form><div>
this message is <span id="word">a correct</span> statement.
</div></body>
</html>
birdbrain
Thanks for this input, however as I am not very good with JS (hence the name 'useless'), I am still a little confused how to change the function that you have created to suit my needs. If I have a number of questions (say 10) how do I need to change that function so that the span id is recognized for each question? That is to say that each question will need to display a correct/incorrect answer.
Thanks again,
useless