Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

hide "H6" tag

In the code below, if the following tag is selected:

<div id="ctl09_ctl08_divPostponedTaskGrid">


How do I hide the sibling above it?   ( the <h6> tag )



<table>
	<tbody><tr>
		<td><span>Completed by: Jaren Morris</span></td><td rowspan="4">

 <h6>Postponed Task</h6>
<div id="ctl09_ctl08_divPostponedTaskGrid">
    <div>

		</div>          
</div>

</td>
	</tr><tr>
		<td><span>Completed Date: 2/25/2013 11:27:23 AM</span></td>
	</tr><tr>
		<td><span>Assigned Role: Client Contact-L1</span></td>
	</tr><tr>
		<td><a href="ViewHTML.aspx?ApprovalQueueID=779111-1" target="Task History">Task View</a></td>
	</tr>
</tbody></table>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Knowlton

ASKER

Thank you.  I am sure that works.

My interim solution:


  $(document).ready(function () {

        $('div[id*="_divPostponedTaskGrid"]').each(function () {

            var tablecount = $(this).children('div').children().size();

            if (tablecount == 0) {               
                $(this).prevAll('h6').hide();
            }
            else {
                $(this).closest('#frame').css('background-image', 'none');
            }
        });

    });     

Open in new window




Was prevAll(  )  an okay choice?

It works - but was it correct?


Also, I am not familiar with select(  )

I thought these were the same thing:

 $('#<%= PostponedTaskGrid.ClientID %>').each(function() {
  $('h6').hide();
});


vs


 $('#<%= PostponedTaskGrid.ClientID %>').select(function() {
  $('h6').hide();
});