Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:25:50+00:00 2026-06-13T17:25:50+00:00

I am testing the existence of dynamic tabs in jQuery. If it exists, select

  • 0

I am testing the existence of dynamic tabs in jQuery. If it exists, select it, if not, create it.

This works 100% in FF, Chrome, etc. I am new to jQuery, so I’m struggling to make this IE 8+ compatible.

    // Does the tab already exist?
    var checkName = satrk;
    var tabExists = false;
    $('#tabs ul li a').each(function(i) {
        if(this.text == checkName) {
            tabExists = true;
        }
    });

    // React to existance:
    if(!tabExists){
        $("#tabs").tabs("add","details.cfm?satrk="+satrk,satrk);
        $("#tabs").tabs("select", satrk); // select tab by index
    }else{
        $("#tabs").tabs("select", satrk); // select tab by index
    }

I pass the tabs index to the check.

Suggestions?

I read elsewhere that “An a element has no text property in IE.” but that’s not enough for me to correct my issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:25:51+00:00Added an answer on June 13, 2026 at 5:25 pm

    try:

    if($(this).text() == checkName) {
    

    I think in your use, this.text is the text property of a DOM object. If you wrap that DOM object in jQuery ($(this)) then it should have a .text() method that will let jQuery sort out the cross browser stuff, and just return the text you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to mimic the in operator, but testing for the existence
Testing in various versions of Firefox new and old it seems that column-span in
I'm testing the existence of a file in a remote share (on a Windows
I've never understood the difference in these two ways for testing the existence of
I'm new to testing, and having troubles debugging like I might normally in a
I have an ASP.NET app using Windows authentication, and I'm testing for the existence
I have a custom Javascript object that I create with new , and assign
I would like advice as to best practice in testing object existence for cross-browser
I am currently testing a small application I have written. I have not been
__if_exists is a microsoft specific keyword for testing existence of identifiers at compile time:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.