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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:44:10+00:00 2026-06-10T05:44:10+00:00

I have to set one src to an image object. Then I change it.

  • 0

I have to set one src to an image object. Then I change it.

But if I add something to the element (content of element), such as

meaning.innerHTML += ")";

(where meaning is parent element of image), then if change the src of object it won’t affect the document.

Example: http://jsfiddle.net/WcnCB/3/

Could you explain me why it happens, and how to fix it?

  • 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-06-10T05:44:12+00:00Added an answer on June 10, 2026 at 5:44 am

    meaning.innerHTML += ')'; does more than you think. Visually it just appends a ) character, but behind the scenes what happens is:

    meaning.innerHTML = meaning.innerHTML + ')';
    

    So, you’re first converting the DOM to a string representation (HTML), then adding a ) character, and finally have convert it back from HTML to the DOM. All elements the HTML represents are created again, and meaning is replaced by those new elements. So your old one is distroyed.

    The simplest solution is to use createTextNode: http://jsfiddle.net/WcnCB/4/.

    meaning.appendChild(document.createTextNode(")"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set the RadDock padding to (0,0,0,0) on one of my windorms, but
I have one question. I want to set one image to image button. I
I want to get the src of one image and set it as another's
i have 20 imageviews with background image set. When user clicks on one image
I have one AlertDialog which is working fine.I have set some background images to
In my init I have set some variables and one animate that uses those
The problem: I have set of pictures, when the user presses on one of
I have an app with four activities. I have set the intent-filter on one
I have a set of data in one JSON structure: [[task1, 10, 99], [task2,
I have a set of buttons on one of my custom entities ribbon and

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.