Solved

hide "H6" tag

Posted on 2013-05-23
2
314 Views
Last Modified: 2013-05-23
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

0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39191833
basically this:
$('#ctl09_ctl08_divPostponedTaskGrid').select(function() {
  $('h6').hide();
});

Open in new window


however by the id i can tell that this is asp control, so the way to do it in jquery is:
 $('#<%= PostponedTaskGrid.ClientID %>').select(function() {
  $('h6').hide();
});

Open in new window

i used PostponedTaskGrid as the asp ctrl name, u should replace it with the real asp control which is rendered there.
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 39191860
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();
});
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question