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 6860491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:24:55+00:00 2026-05-27T02:24:55+00:00

I have an issue with internet explorer dealing with JQuery or JQuery dealing with

  • 0

I have an issue with internet explorer dealing with JQuery or JQuery dealing with IE 🙂

Simply I have the following code:

$(function () {
   $("*").each(function (i) {
    var textalign = $(this).css("text-align");
    if (textalign == "left") {$(this).css({'text-align': 'right'});} 
      else if (textalign == "right"){$(this).css({'text-align': 'left'});}
   });
}); 

The function of code is to swap text-align of all tags, in FF & Chrome this code do perfect work, but on IE I have a problem on it, I think it read inherited text-align property after changing parent property and swap it again !

To Understand what happening, i attached here 2 images of source code after applying JQuery code:

In FF (Perfect !) : Firefox result's source code snapshot

In IE (Wrongly !) : IE result's source code snapshot

BTW, if you wondering about use this way, I have Open Source project and using inline styling on hundreds of JSPs, with tables too, so Its workaround solution to flip layout and support multilingual product (support ltr & rtl languages) …

Hopefully found solution.

Note: I’m using JQuery 1.7.1 … and this problem issued in ie8 & ie9.

Note 2: I got worst results when using jQuery("*").each(jQuery("*").get().reverse(), function (i) { or jQuery(jQuery("*").get().reverse()).each(function (i) {

Edit 1 & 2: was inside this question

Edit 3:

Note 3 : the issue is happening with all elements on page whatever that element even script , html , style , … etc and strangest thing some of elements did not get any touch ! see this screenshot:
all elements but some too !

Edit 4:

My problem partially solved, on IE9 working well, in IE8 not working, solution from Stefan , after trying alot of ways the summery on my code:

in JQuery code:

if (jQuery.browser.msie == false || jQuery.browser.msie == undefined) { 
            if (textalign == "left") {jQuery(this).css({'text-align': 'right'});} 
            else if (textalign == "right"){jQuery(this).css({'text-align': 'left'});}
        }

In CSS file that loaded for IE only :

body *[style*="text-align: left"] {
  text-align: right !important;
}

body *[style*="text-align: right"] {
  text-align: left !important;
}

Regards,

  • 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-05-27T02:24:56+00:00Added an answer on May 27, 2026 at 2:24 am

    Couldn´t this be of any help?

    body.rtl * {
      text-align: right !important;
    }
    

    You really should mark the elements that should keep the rule for text-align: left with a specific CSS class to separate them from the rest.

    You may also try this CSS to switch text-align values

    body *[style*="text-align: left"] {
      text-align: right !important;
    }
    
    body *[style*="text-align: right"] {
      text-align: left !important;
    }
    

    I´ve not tested this one yet but it should make all elements with a style attribute value containing “text-align: left” to use that rule.

    UPDATE

    Created an example at jsFiddle. Hope it helps.

    UPDATE 2

    New solution using jQuery: jsFiddle

    $('body *[style*="text-align"]').each(function() {
    
        // Toggle text-align value
        $(this).css('text-align', (($(this).css('text-align') == 'left') ? 'right' : 'left'));
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Internet Explorer (don't appear to have an issue in FireFox) the following code
This issue occurs in our beloved Internet Explorer 7: I have a list of
I've run into a strange Internet Explorer 8 issue. I have the following Javascript:
I'm having a design issue using jQuery FadeIn on Internet Explorer: I have a
I have an issue with list-style-image property in CSS with Internet Explorer 8 If
I have an issue where Internet Explorer is generating an additional br element that
I'm having an issue with a page in internet explorer. I have an ajax
I'm having a serious issue with Internet Explorer caching results from a JQuery Ajax
i am having a internet / security issue with some code i have written.
I'm seeing this issue in Internet Explorer 8, but not in Safari or Firefox.

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.