www.webdeveloper.com
Results 1 to 3 of 3

Thread: How can I hide “<li>” by text using jquery?

  1. #1
    Join Date
    Feb 2009
    Posts
    95

    How can I hide “<li>” by text using jquery?

    Hi,

    How can I hide “<li>” by text using jquery? For example how can I hide ”REPORTS COORDINATORS” “<li>”.

    I need 2 separate statements to hide “CASE COORDINATORS” and ”REPORTS COORDINATORS” “<li>” using jquery?

    My HTML Code:
    Code:
    <div id="container">
    	<ul class="yui-nav">
    		<li title=""><a href="#"><em><b>CASE COORDINATORS</b></em></a></li>
    		<li><a href="#"><em><b>DOCUMENT MANAGEMENT</b></em></a></li>
    		<li><a href="#"><em><b>REPORTS COORDINATORS</b></em></a></li>
    		<li><a href="#"><em><b>QUALITY ASSURANCE</b></em></a></li>
    	</ul>
    </div>
    Thanks

  2. #2
    Join Date
    Nov 2010
    Posts
    1,097
    Code:
    <script type="text/javascript"> 
    $(document).ready(function() {
    $('li').each(function() {
    $(this).toggle(!($(this).is(":contains(CASE COORDINATORS)")||$(this).is(":contains(REPORTS COORDINATORS)")));
    	});
    });
    </script>

  3. #3
    Join Date
    Feb 2009
    Posts
    95
    Thank you. It works.

    Quote Originally Posted by xelawho View Post
    Code:
    <script type="text/javascript"> 
    $(document).ready(function() {
    $('li').each(function() {
    $(this).toggle(!($(this).is(":contains(CASE COORDINATORS)")||$(this).is(":contains(REPORTS COORDINATORS)")));
    	});
    });
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles