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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:23:01+00:00 2026-05-22T22:23:01+00:00

I am using IE7. I have an input box as follows: <input name=location type=text

  • 0

I am using IE7. I have an input box as follows:

<input name="location" type="text" id="location" maxlength="512" size="20" class="editable text"/>

And I am trying to do the following:

$("#location").addClass('flagged');

But this wipes out all existing styling of the text box. The class ‘flag’ does not have any styling associated with it. The existing classes have the following CSS:

input.editable {
    height: 18px;
    background-color: #FFFFCC;
    padding-top: 0px; 
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    border:#FFFFCC 1px solid;
    margin:0px;
}

input.text {
    text-align:left;
    height:19px;
    width:100px;
}

If I manually add the class ‘flagged’ to the input box, all styling remains intact. In Firefox the jQuery addClass() does not clear all styling. Why is this happening in IE7?

EDITED
I’ve narrowed it down to this…

if (!String.prototype.trim) 
{
    String.prototype.trim = function(){
        // stuff
    }
}

The

String.prototype.trim = function(){}

declaration seems to be causing the problem. Any ideas?

EDITED AGAIN It seems to not like the fact that it’s being called ‘trim’. 2 Hours of the day well spent 😐

  • 1 1 Answer
  • 3 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-22T22:23:02+00:00Added an answer on May 22, 2026 at 10:23 pm

    Try seeing the classes assigned to the element, IE:

    var myClass = $('#location').attr('class'); 
    
    alert("classes = " + myClass);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know IE7 & IE8 supposedly have support for using multiple CSS class selectors,
I have am using an image button instead of text for a submit button
I have a text input with a search buton absolute positioned over it... to
I am using the following code to disable the submit button $(input[type='submit']).attr(disabled, disabled); And
Browse to a webpage with hyperlinks using IE (I am using IE7) Once on
I built some cross fade rollovers in IE7 using this single image technique: http://jqueryfordesigners.com/image-cross-fade-transition/
Using html and css for IE7, how do I position a html table at
When using a browser to transform XML (Google Chrome or IE7) is it possible
Is there any way to differentiate IE7 versus IE6 using PHP's get_browser() function?
I'm trying to force Safari or IE7 to open a new page using a

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.