-3

i want to hide element with text from div element. for example i have this element :

<div style="position: absolute; left: 10px; 
            bottom: 10px; z-index: 100000; 
            visibility: visible; display: block; 
            color: rgb(255, 255, 255); 
            text-shadow: none; font-family: sans-serif; 
            font-size: 10px; font-weight: bold; 
            padding: 2px; border: 1px solid rgb(68, 0, 0); 
            background-color: rgb(221, 0, 0);">
   hi all users
 </div>

in this code i want to hide this div with using hi all users text. please help me. thanks

DolDurma
  • 15,753
  • 51
  • 198
  • 377

1 Answers1

1

You should be able to use the :contains selector for this:

$('div:contains("hi all users")').css('display', 'none');

Example

Matthew Darnell
  • 4,538
  • 2
  • 19
  • 29