logo
Tags down

shadow

Hide a class if it contains a certain text


By : ED1T
Date : September 15 2020, 06:00 AM
help you fix your problem The sentence end date is empty belongs to div, not to span, from your html. Therefore you can use :contains to check if the div text has your desired text
code :
$('.spanLabel:contains(" end date is empty")').hide()
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="spanLabel">
  <span class="boldLabel">END DATE: </span> end date is empty
</div>

<div class="spanLabel">
  <span class="boldLabel">END DATE: </span> end date is not empty
</div>


Share : facebook icon twitter icon

how can I hide a text by referring to a CSS class or id?


By : user3097799
Date : March 29 2020, 07:55 AM
Does that help you have wrong class definition at tag (don't use a dot)
use this comment

CSS Hide some text with class and id


By : Daniel
Date : March 29 2020, 07:55 AM
like below fixes the issue You can try using :lang selector css. But, it can be tricky taking into account all cases, xml lang etc. I think the javascript to detect the user's browser's language is simple, so why not just set a global class based on that, and then you can hide / show with css accordingly. You do need to make sure you've got a complete list of possible lang values.
code :
var language = window.navigator.userLanguage || window.navigator.language;
alert(language);
document.getElementById('content').className = language;
div {
  visibility: hidden;
}
#content.fr .french {
  visibility: visible;
}
#content.en-US .english {
  visibility: visible;
}
#content.sp .spanish {
  visibility: visible;
}
<div id="content" class="default">
  <div class="french">Si votre navigateur préférence lang est francais , vous devriez voir cette
  </div>
  <div class="english">If your browser lang preference is ENGLISH you should see this
  </div>
  <div class="spanish">Si su navegador lang preferencia es espanol debería ver esto
  </div>
</div>

Hide all elements that class that contains text


By : Daniel Taparelli
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Basically, I have a few elements with class temp_val that contain a 1 value that I want to hide. These elements are scattered in my html file. , Try following code it should work for you.
code :
$(".temp_val_name").each(function() {
    if ($(this).text() === '') {
        $('.temp_val').hide();
    }
});

Hide text if css class not declared


By : Pradeep
Date : March 29 2020, 07:55 AM
this will help I want to hide a text: , When crp-list class is present in a DOM.
code :
if ($(".crp-list").length !== 0) {
  $(".showrelated").show();
} else {
  $(".showrelated").hide();
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<strong class="showrelated">In Verbindung stehende Artikel: </strong>

<div class="crp-list"></div>
if ($(".crp-list").length !== 0) {
  $(".showrelated").show();
} else {
  $(".showrelated").hide();
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<strong class="showrelated">In Verbindung stehende Artikel: </strong>

How to hide a text which has no tags, no id, no class?


By : Maksim Tcytcerov
Date : March 29 2020, 07:55 AM
I hope this helps you . jQuery solution :
You could filter the text using nodeType and remove the text :
Related Posts Related Posts :
  • Get second last message with Discord.Js
  • Is there anyway to return a "no searches found" with this javascript?
  • javascript addEventListener in react js component not working
  • Why does an alert box keep popping up with the word "undefined"
  • Should I use Jquery to click toggle instead of React?
  • Angular I don't call a function with (load)
  • Is there a way of making a javascript loop to repeatedly press a button?
  • How do I create a function that accepts multiple arguments to perform an arithmetic calculation in JavaScript?
  • Cancel Async/Await
  • How to rerender when refs change
  • Is there a more run-time efficient way to iterate through this array? (JavaScript)
  • Is there a more concise way to write this without a bunch of IF statements?
  • Filter Nested JSON based on the Object
  • Sankey-diagram PowerBI custom visual with color nodes and ordering
  • JavaScript anonymous function simulating arithmetic in lambda calculus, result returns `undefined`
  • How to uglify ES6 javascript with Flask?
  • How to fetch data from RESTAPI with react.js
  • Why does RETURN shows different output in javascript
  • How to correctly store an array of RegEx values in a JSON file and retrive it from Javascript?
  • How to solve slow loading page containing database information
  • React unwanted submit on every character inputed
  • Is it bad form to include <span> and <br> within <td> elements?
  • 'Product' s defined but never used in react?
  • "RNCSafeAreaView" was not found in the UIManager
  • Using Regex inside a textarea in Angular template driven form
  • Entering data directly into a table
  • How disable to select minutes in v-time-picker widget?
  • Rebind an event handler that was unbound with .off() method jQuery
  • In Angular 7 how to load CSS of Arabic language (RTL) from English language (LTR)
  • Unable to use a `Symbol` for a `Group` with paper.js
  • Can vuejs be used inside webcomponent?
  • Load "External" CSS (bootstrap) to specific DIV
  • How to make a checkbox show/hide text with onChange event
  • Is it ok to add meta tag in head using jQuery?
  • How to print to screen all array elements stored in local storage
  • React Native: How to pass params to parent component from child component prop
  • jQuery replace span contains comma with single comma
  • JavaScript function to convert unicode pseduo-alphabet to regular characters?
  • How can I pass parameter correctly?
  • How to create and render an app.json file for Heroku
  • Javascript - Is there a clearer way to express "if (a && b || !a && !b)"?
  • Date Validation in Javascript on Chrome
  • Cannot read a an object in Component, React
  • Can I use conditionals to render a grid widget?
  • How to minify index.html file with hundreds of scripts?
  • How to replace a string with another and with a different colour in ReactJS?
  • i need to give two clicks when the keyboard is open -- React native
  • CodeIgniter Update a row of two tables
  • Bootstrap CSS/Javascript For Carousel Only
  • Using Ionic (angular).Unable to access Hardware back button of mobile devices which have buttons inside the display/scre
  • should I use one component for edit and view with ngif or divided them to components?
  • Referential transparency in functional programming
  • Disable serviceWorker when online
  • How to get the coordinates of the pin/marker using ESRI and JavaScript?
  • Longest decrease subsequence subarray in Javascript
  • Update value from database with the hashed content from another column
  • eror 404 in react-routing
  • Youtube video in <object> tag
  • Is there a way to check null or undefined in a series of object of objects in lodash
  • .save() does not change the value of a field , django
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk