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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:32:50+00:00 2026-05-11T15:32:50+00:00

I’m having issues with internet Explorer. I have a link which duplicates a file

  • 0

I’m having issues with internet Explorer. I have a link which duplicates a file upload element on a form. The code which duplicates also appends a hyperlink to the duplicated upload element which is supposed to remove the duplicated element a simple remove this link.

The issue is that this code runs fine in firefox but it doesn’t run at all in IE. Forget how the code is written out – the onClick event which I attach to the element doesn’t fire at all!

I’m creating my remove link element like this in the function:

var a = document.createElement('a'); a.setAttribute('href', 'javascript:void(0);'); a.setAttribute('class', 'delete'); a.setAttribute('onClick', 'removeThisElement(idOfParentContainer, this)');  container.appendChild(a); 

This works fine in firefox but it doesn’t fire at all in IE. I checked the dom using IE inspector and the link has rendered nicely however the class attached to it hasn’t rendered or been applied and neither has the event fired even though it has physically been appended to the link on the html. For some reason the onClick event is not even firing no matter what code I put in it even if its an alert. Am I missing something here. 🙁


Great got part one of the issue solved by attaching events using AddEvent however why isn’t the css rendering I mean the class attached to the element doesn’t render at all for some weird reason 🙁


Good advice indeed – I’m rewriting my code to avoid the setAttribute function and instead porting all this DOM manipulation to jquery. Thanks for the helps guys

  • 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. 2026-05-11T15:32:51+00:00Added an answer on May 11, 2026 at 3:32 pm

    Event handlers are not DOM attributes, the attribute exists in markup only – I’m not sure why FF oks this. I’ll go research that now cause I want to know.

    Update: seems to be mixed feelings about whether eventhandlers are DOM-valid attributes or not. Looks to me like this is MS’s fault as they internally do not treat them as attributes, whilst the HTML spec indicates that they very much are. The direct consequences of this are that a number of things !IE would consider attributes cannot be set with setAttribute in IE including eventhandler bindings and importantly also style, class and name. apparently IE8 fixes this but I still haven’t installed that so I can’t check.

    Meanwhile, for event binding use the addEventListener/attachEvent pair instead, or (less preferably because it’s a direct assignment) set a.onclick directly to your target method (or more likely a closure on your method).

    To fix your styling not being correctly applied use element.style = foo; or (better) element.className = bar.

    Essentially the problem is setAttribute. Avoid using it.

    For reference…

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

Sidebar

Ask A Question

Stats

  • Questions 229k
  • Answers 229k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It should probably be in a complete plist format (with… May 13, 2026 at 1:45 am
  • Editorial Team
    Editorial Team added an answer We do have this kind of situation here. When that… May 13, 2026 at 1:45 am
  • Editorial Team
    Editorial Team added an answer It would be worthwhile if you mentioned what OS you… May 13, 2026 at 1:45 am

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.