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

  • Home
  • SEARCH
  • 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 6554035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:39:09+00:00 2026-05-25T12:39:09+00:00

document.getElementById(displayImage).getElementsByTagName(img)[0].src = image2.png I seem to remember that for IE, you need to add

  • 0
document.getElementById("displayImage").getElementsByTagName("img")[0].src = "image2.png"

I seem to remember that for IE, you need to add a <meta> tag of some description, but I can’t find which one.

If it helps:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0;

Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR

3.5.30729; .NET CLR 3.0.30729) Timestamp: Tue, 6 Sep 2011 12:23:00 UTC

Message: Object doesn’t support this property or method

  • 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-25T12:39:10+00:00Added an answer on May 25, 2026 at 12:39 pm

    As I mentioned in a comment above, the code is fine; there’s no need for a meta tag. I suspect there is some other JavaScript error occurring before the code executes. It’s either that, or the elements don’t exist in the document when the code executes.

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

Sidebar

Related Questions

if (document.getElementById) { function alterImg() { document.body.getElementById('sendimg').src=url('images/tridown.png'); } } and then the html: <div
I want to use document.getElementById in the src of script tag like this: <div
document.getElementById('num1').innerHTML = homestead[0].textContent; document.getElementById('num3').innerHTML = homestead[1].textContent; } </script> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8 />
document.getElementById doesn't seem to work across all browsers (I mean some old ones) and
var x = document.getElementById(pic); x.src='path.jpg'; Shouldn't this replace the source of the the image
I have this code: document.getElementById('img'+i).onclick = function(){popup_show('popup',array_msg[i]+'|||'+date('Y-m-d',strtotime(lec_date))+'-==-'+str_view_forConflict, 'AddEditSchedule;;popup_drag2;;EditSched;;'+String(array_msg_id[3])+';;view', 'popup_drag', 'popup_exit', 'screen-center', 0, 0);}; ...but
document.getElementById(main).src = '02.jpg'; works but $('#main').src = '02.jpg'; doesn't
document.getElementById(myFrame).setAttribute(src) = http://www.yahoo.com/; myFrame is an iframe element... when entering this into the chrome
Using document.GetElementById(thingieID) doesn't seem to work. Can anyone help this DOM newbie?
myDiv = document.getElementById('results'); div = myDiv.getElementsByTagName('div'); for (var i = 0; i < div.length;

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.