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

The Archive Base Latest Questions

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

I’am doing some form validation and noticed that Internet Explorer don’t works correctly (as

  • 0

I’am doing some form validation and noticed that Internet Explorer don’t works correctly (as always). If I attach some text and CSS into a div-element and delete it again (when the input is ok) the Explorer doesn’t correct the display again. I mean the text gets deleted, but there still remains a blank row (as if there is br-element). I’ve checked the source-code and the CSS was deleted correctly, but the display isn’t correct. Why?

Other browsers have no problems.

    if(bla)
    { 
      $("div[bez='avz_kw_err']").eq(index).html("Mindestens 3 Zeichen"); 
      $("div[bez='avz_kw_err']").eq(index).attr("style","color:red; font-size:12px; line-height:12px; position:relative; top:5px; left:25px;");
    }
    else
    { 
      $("div[bez='avz_kw_err']").eq(index).html(""); 
      $("div[bez='avz_kw_err']").eq(index).attr("")
    }
  • 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-27T16:24:32+00:00Added an answer on May 27, 2026 at 4:24 pm

    Don’t use “.attr()” to set the style property with jQuery 1.6 or newer. Use “.prop()” instead:

    $("div[bez='avz_kw_err']").eq(index).prop("")
    

    The “style” property is a property. IE is very picky about the difference. Use “.prop()” for anything that, when dealing directly with the DOM element un-wrapped by jQuery, you’d treat as an ordinary property of the object: “name”, “id”, “className”, “tagName”, etc.

    edit because I’m slow this evening — that said – and it’s all true – the “style” property in particular is not a string-valued property. It’s an object in its own right, and setting it to “” doesn’t really make sense (to Firefox or IE). But you can zap all the CSS properties:

    $("div[bez='avz_kw_err']").eq(index).each(function() {
      for (var cssp in this.style) {
        this.style[cssp] = '';
      }
    });
    

    edit again — hey gang stop upvoting me until I figure out the right answer – this may not work in IE …

    edit boy is IE weird … OK in IE8 this works:

    $("div[bez='avz_kw_err']").eq(index).each(function() {
      for (var cssp in this.style) {
        try { this.style[cssp] = null; } catch (who_cares) {}
      }
    });
    

    It’s apparently important to use null instead of the empty string; at some point setting something to the empty string caused IE to seize up and spin the CPU for a few seconds.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need a function that will clean a strings' special characters. I do NOT

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.