Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
I want to hide <i> tag whose data-original-title="Close" after page loads but it is visible in jquery

I have a page which opens in Modal window and I want to hide <i> tag whose data-original-title="Close" after page loads with the following code but it doesn't work: I am using SAAS system where there is an option to open a page in MODAL window.

function startUp() {    
  $("i[data-original-title='Close']").hide();
}    

<body onload="startUp(); return true;">    
</body>

I tried document.addEventListener('DOMContentLoaded'... as well

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Given your use case and the JS code being supplied by a third party, I would recommend just using a CSS rule in your styles.css (or whatever file name) file.

.sswindow-backdrop i[data-original-title=Close] {
   display:none !important;
}
about 4 years ago · Juan Pablo Isaza Report

0

try

function startUp() {    
  $("i[data-original-title='Close']").attr("style", "display:none!important");
}
about 4 years ago · Juan Pablo Isaza Report

0

Attribute selectors use double quotes (") & not single quotes ('). jQuery does not throw any error, if the element does not exist in the DOM. So better use Vanilla js to debug:

 var closeBtn = document.querySelector('i[data-original-title="Close"]');
 closeBtn.style.display = 'none';

You have not provided enough code or DOM screenshot in your question, but I strongly suspect you the modal's content is in an iframe, in which case it is in a separate DOM.

 var iframe = document.querySelector('iframe');
 iframe.addEventListener('load', (evt)=> {
     // hide close button here.
 });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!