Javascript displaying dynamic content
<p>I wanted to display a different message in the same <code>&lt;div&gt;</code> when the user makes a selection from a radio button. It works, but it's not as clean as I'd like. Here's the code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function showhide(t) {
        var target = document.getElementById('bankingdetails');
        if (target.style.display == 'none') {
            var text = 'Please effect payment to the following account:&lt;br /&gt;';
            var accountnum = 'Account Number: 39485620346&lt;br /&gt;';
            var branchcode = 'Branch Code: 34985&lt;br /&gt;';
            var branchname = 'Branch: F00 Bank Whoville';
            if (t == 0) {
                // User opted for Online Payment
                target.style.display = 'block';
                target.innerHTML = 'Please click here to go to PayPal:&lt;br /&gt;&lt;a href="http://www.paypal.com"&gt;Go to PayPal&lt;/a&gt;';
            } else {
                target.style.display = 'block';
                target.innerHTML = text + accountnum + branchcode + branchname;
            };
        } else {
            target.style.display = 'none';
        };
    };
&lt;/script&gt;

&lt;input type="radio" name="radPayment" onclick="showhide(0);" /&gt;Pay Online
&lt;input type="radio" name="radPayment" onclick="showhide(1);" /&gt;EFT
</code></pre>

<p>Right now, I can click either radio button to display it's message, but... I have to click it again, or click on the other one to hide the visible message.</p>

<p>What I'd like is to change the text that displays on the page so that if the EFT text is visible, if I click on the Pay Online button, the text will change immediately.</p>

<p>Thanks in advance!</p>
