JavaScript How can I find specific string in li>div and hide it find specific string in excel,find specific string in python,

I have a ul list which has li's and in li there is div with no class and id. I just want to find li>div which has text saying 'Certificats et forfaits' and hide anchor tag which is next to it. Is it possible?

Here is my code

<ul class="select2-choices">  
    <li class="select2-search-choice">    
        <div>Informatique Électronique</div>    
        <a target='_blank' href="#" class="select2-search-choice-close" tabindex="-1"></a>
    </li>
    <li class="select2-search-choice">   
        <div>Informatique Électronique &gt; Accessoires Informatique</div>
        <a target='_blank' href="#" class="select2-search-choice-close" tabindex="-1"></a>
    </li>
    <li class="select2-search-choice">    
        <div>Mode et Accessoires</div>    
        <a target='_blank' href="#" class="select2-search-choice-close" tabindex="-1"></a>
    </li>
    <li class="select2-search-choice">    
        <div>Certificats et forfaits</div>    
        <a target='_blank' href="#" class="select2-search-choice-close" tabindex="-1"></a>
    </li>
    <li class="select2-search-field">    
        <label for="s2id_autogen3" class="select2-offscreen"></label>    
        <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" id="s2id_autogen3" placeholder="" style="width: 20px;">  
    </li>
</ul>

In my above list I want to find text Certificats et forfaits which is in div always and it will be always after li, once I find that I need to hide anchor tag next to it. How can I achieve this any help?

Answer:1

If you know which number in the list needs to be hidden then you can use the :nth-child(#) selector. Here is how you would hide the anchor tag based on the code your provided:

.select2-search-choice:nth-child(4) a {
  display: none;
  }
Answer:2

The controller I'm using is: angular.module('app.PostView', []) .controller('PostViewCtrl', function($scope, $http, Constants) { $scope.posts = []; $scope.doSomething = function(){ ...

The controller I'm using is: angular.module('app.PostView', []) .controller('PostViewCtrl', function($scope, $http, Constants) { $scope.posts = []; $scope.doSomething = function(){ ...

I want to delete "()" from each value. How would I do that? var arr = ["(one)","(two)","(three)","(four)","(five)"]; for(var i = 0; i < arr.length; i++){ console.log(arr[i]); }

I want to delete "()" from each value. How would I do that? var arr = ["(one)","(two)","(three)","(four)","(five)"]; for(var i = 0; i < arr.length; i++){ console.log(arr[i]); }

  1. javascript trim characters from end
  2. javascript trim character from start
  3. javascript trim characters from beginning of string
  4. javascript trim character from start and end
  5. javascript trim character length
  6. javascript trim character limit
  7. javascript trim last character
  8. javascript trim first character
  9. javascript trim specific character
  10. javascript trim after character
  11. javascript trim right character
  12. javascript trim special characters
  13. javascript trim last character if comma
  14. javascript trim last character of string
  15. javascript trim first character from string
  16. javascript trim custom characters
  17. javascript trim other characters
  18. javascript trim last character if slash

I have been trying to parse nested JSON data and below is my code var string = '{"key1": "value", "key2": "value1", "Key3": {"key31":"value 31"}}'; var obj = JSON.parse(string); console.log(obj.key1) ...

I have been trying to parse nested JSON data and below is my code var string = '{"key1": "value", "key2": "value1", "Key3": {"key31":"value 31"}}'; var obj = JSON.parse(string); console.log(obj.key1) ...

  1. parsing nested json in python
  2. parsing nested json in javascript
  3. parsing nested json in java
  4. parsing nested json data in javascript
  5. parsing nested json c#
  6. parsing nested json swift
  7. parsing nested json golang
  8. parsing nested json in vba
  9. parsing nested json in spark
  10. parsing nested json in node js
  11. parsing nested json in flutter
  12. parsing nested json array in java
  13. parsing nested json using jackson
  14. parsing nested json with pandas
  15. parsing nested json in pyspark
  16. parsing nested json logstash
  17. parsing nested json in java using jackson
  18. parsing nested json objects in python
  19. parsing nested json in swift 4

I am self taught PHP with little js experience so it is probably something really simple, but I have made a js function to change the inner html of a table cell and added an onchange event listener on ...

I am self taught PHP with little js experience so it is probably something really simple, but I have made a js function to change the inner html of a table cell and added an onchange event listener on ...

  1. change inner html jquery
  2. change innerhtml javascript
  3. change inner html css
  4. change innerhtml onclick
  5. change inner html with php
  6. change innerhtml
  7. javascript change innerhtml
  8. change innerhtml using jquery
  9. change innerhtml of div
  10. angular change innerhtml
  11. change inner html of span
  12. react change innerhtml
  13. jquery change innerhtml of div
  14. change innerhtml of element
  15. change innerhtml on click jquery
  16. change innerhtml text
  17. change innerhtml using javascript
  18. change innerhtml of class
  19. change innerhtml of label
  20. function change innerhtml