Using javascript/jQuery to hide certain elements on screen retrieved from $.post
<p>most likely an easy solution, but please forgive my early learning curve in the world of programming and using php with jquery together. I'm able to retrieve information from the database easily and display that on the screen. However, I'd like to be able to hide certain elements that are retrieved from the database and written out in php on the page and show them on a click event. I'm able to do this easily on other sections of the website, that are not being retrieved using $.post. Are there certain rules that apply with jQuery once I've used $.post and ajax to retrieve info from the database? </p>

<p>php below: </p>

<pre><code>&lt;?php echo "
    &lt;div class='phone_tracking customCall separation'&gt;
        &lt;h3&gt;Phone Tracking&lt;/h3&gt;
        &lt;a class='showCustomDatePhone' href='#customDate_individualPhone'&gt;View &amp;amp; Listen to Individual Phone Leads &gt;&gt;&lt;/a&gt;
        &lt;table&gt;
            &lt;tr class='tableHead'&gt;
                &lt;td&gt;Date&lt;/td&gt;
                &lt;td&gt;Traffic+ Calls&lt;/td&gt;
                &lt;td&gt;New Vehicle Calls&lt;/td&gt;
                &lt;td&gt;Used Vehicle Calls&lt;/td&gt;
                &lt;td&gt;Service Calls&lt;/td&gt;
                &lt;td class='totalTally'&gt;Total Calls&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;`$valueRetrieved` - `$valueRetrieved2`&lt;/td&gt;
                &lt;td&gt;$customDateTrafficPlusTally&lt;/td&gt;
                &lt;td&gt;$customDateNewVehicleTally&lt;/td&gt;
                &lt;td&gt;$customDateUsedVehicleTally&lt;/td&gt;
                &lt;td&gt;$customDateServiceTally&lt;/td&gt;
                &lt;td&gt;$customDateTally&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
        &lt;div id='customDate_individualPhone'&gt;
            &lt;h4&gt;All Individual Phone Calls For `$valueRetrieved` - `$valueRetrieved2`&lt;/h4&gt;
            &lt;table&gt;
                &lt;tr&gt;
                    &lt;td&gt;Date&lt;/td&gt;
                    &lt;td&gt;Ad Source&lt;/td&gt;
                    &lt;td&gt;Caller Phone Number&lt;/td&gt;
                    &lt;td&gt;Tracking Phone Number&lt;/td&gt;
                    &lt;td&gt;Target Phone Number&lt;/td&gt;
                    &lt;td&gt;Call Duration (in seconds)&lt;/td&gt;
                    &lt;td&gt;Result of Phone Call&lt;/td&gt;
                    &lt;td&gt;Call Listen Link&lt;/td&gt;
                &lt;/tr&gt; " . $showTheCustomDatePhoneTable ."
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
"; ?&gt;
</code></pre>

<p>jQuery below: </p>

<pre><code>                    $('#customDate_individualPhone').hide();
                $('.showCustomDatePhone').click(function(){
                    var txt = $("#customDate_individualPhone").is(':visible') ? 'View &amp; Listen to Individual Phone Leads &gt;&gt;' : '&lt;&lt; Hide Individual Phone Leads';
                    $(".showCustomDatePhone").text(txt);
                    $('#customDate_individualPhone').toggle();
                });
</code></pre>

<p>The ajax to retrieve the data (if that helps)</p>

<pre><code>                    $('#getDateRange').on('click', function(){
                    var startDate = $('#dateStart').val();
                    var endDate = $('#dateEnd').val();
                    if ($.trim(startDate) != '') {
                        $.post('../../includes/dateRangeWhitePlainsNissan.php', {dateStart: startDate, dateEnd: endDate}, function(data){
                            $('#fromDatabase').html(data);
                        });
                    }
                });
</code></pre>

<p>I'm still very new to programming so you're help is greatly appreciated! Thanks</p>
