|
OK straight off the bat, what I'm trying to do on a webpage I'm making is to have 3 pairs of radio-buttons (Yes and No answers to three questions) and when the visitor has made a selection for all three pairs, an answer appears below.
This should be simple because it's only the [u]one[/u] answer - "If you answered yes to all three questions then..."
I'm thinking I could make the answer text white - as that's the background colour, and have it change to black when there's been a selection made for each pair of radio-buttons - I just have no idea how to code that into html!
I'd be greatly appreciative if anybody could show me how this could be done.
|
|
|
Here is one way:
<script language=javascript>
function InsertContent() {
document.getElementById("mydiv").innerHTML = "This is the text I want to display.";
}
</script>
<a href="javascript:InsertContent();">do it</a>
<p>
<div id="mydiv"></div> |
|
Here is another:
<script language=javascript>
function InsertContent() {
x = document.getElementById("mydiv");
x.style.display = "inline";
}
</script>
<a href="javascript:InsertContent();">do it</a>
<p>
<div id="mydiv" style="display:none;">This is the text I want to display.</div> |
|
I just typed this into this reply--I did not test it, and since I average 2 errors per line of code, don't be surprised to fine a problem!
|
|
|
|
|
|
|
|
|
// |