apply css to a html element after finding some specific class name avaialble <p>I am trying to apply css to a div(.references) after finding a specific class name(.overview) available in anywhere in that document. its not working .references div not inside .overview div</p> <pre><code>if ($('div').hasClass('overview')) { $('.references').css("display", "none !important"); } </code></pre> <p>Please help</p>