Using an onclick function in a div to show/hide another div
<p>I've done this before, but for some reason it's not working this time, and I've been staring at it for so long that I've pretty much guaranteed I'll never find the problem...</p>

<p>I have this chunk of HTML, which creates a form.</p>

<pre><code>&lt;div class="paymentForm"&gt;               

    &lt;span class="pgHeading" style="margin: 30px 0;"&gt;Payment Information&lt;/span&gt;
    &lt;div class="inputRedTemplate paymentType inputRoundedTop" onclick="javascript:displayPaymentFields()"&gt;
        &lt;div class="label"&gt;Credit Card&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="inputRedTemplate paymentType"&gt;
        &lt;div class="label"&gt;Cash&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="inputRedTemplate paymentType inputRoundedBottom" onclick=""&gt;
        &lt;div class="label"&gt;Check&lt;/div&gt;
    &lt;/div&gt;

    &lt;div id="cashPaymentBlock"&gt;
        &lt;span&gt;For cash payments, bills higher than $20 will not be accepted.&lt;/span&gt;
    &lt;/div&gt;

    &lt;div id="ccPaymentBlock"&gt;
        &lt;span class="ccDisclaimer" style="margin: 30px 0;"&gt;
           Your credit card transaction will be processed by your store location and you must
           present your credit card to the driver at the time the store delivers your order for a
           credit imprint and your signature.
        &lt;/span&gt;

        &lt;input id="card_name" name="cardName" class="inputRedTemplate inputFullWidth" placeholder="Cardholder Name" /&gt;
        &lt;input id="card_number" name="cardNumber" class="inputRedTemplate inputFullWidth" placeholder="Card Number" onkeypress="return checkNumbers(event,this)" /&gt;
        &lt;div class="error" id="err_msg" style="display: none;"&gt;Numbers only!&lt;/div&gt;

        &lt;input id="card_type" name="cardType" class="inputRedTemplate inputFullWidth inputRoundedBottom" placeholder="Credit Card Type" /&gt;
        &lt;input id="card_expire_month" name="cardExpireMonth" class="inputRedTemplate gcNumber" placeholder="2 Digit Expiration Month" /&gt;
        &lt;input id="card_expire_year" name="cardExpireYear" class="inputRedTemplate gcPin" placeholder="4 Digit Year" /&gt;
        &lt;input id="card_zip" name="cardZip" class="inputRedTemplate inputFullWidth inputRoundedBottom" placeholder="Billing ZIP Code" /&gt;
    &lt;/div&gt;
    &lt;div class="btnRedTemplate btnFullWidth checkoutBtn floatLeft" style="margin-top:30px;" onclick="" title="Submit Button" /&gt;Submit&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I have the following script:</p>

<pre><code>&lt;script&gt;
    $(document).ready( function () {
        hideAllPaymentBlocks();
    })

    function hideAllPaymentBlocks() {
      $('#cashPaymentBlock').hide();
      $('#ccPaymentBlock').hide();
      // add line for checks, too
    }    

    function displayPaymentFields() {
        $('ccPaymentBlock').show();  
    }

&lt;/script&gt;
</code></pre>

<p>The <code>hideAllPaymentBlocks</code> function runs correctly in the ready function, but <code>displayPaymentFields</code> doesn't seem to be running upon clicking the Credit Card div. There are no errors; it just doesn't do anything. Can anyone point me in the right direction? As I said, I've been staring at this a while now, and I'm sure it's an easy fix but I can't get my brain working.</p>
