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

The Archive Base Latest Questions

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

jQuery: v1.7.1 Hello guys, I changed the img attributes from jQuery Like this: $(document).ready(function

  • 0

jQuery: v1.7.1
Hello guys,
I changed the img attributes from jQuery Like this:

        $("document").ready(function () {
        $("img").attr({ src: "images/Spring.jpg", alt: "spring" });
    });

Changes are reflected in the browser but,
1) when I checked the “view source code” there were no changes(it was original html) which were changed by the js ,why?
Like this:

    <a href="images/Grass.jpg">
    <img src="images/Grass.jpg" alt="image"/> </a>

2) And when I checked from Firebug it showed the changes made by jquery ?

<a href="images/Grass.jpg">
<img alt="spring" src="images/Spring.jpg"> </a>

Whats going on here ?
Q) Are the changes made to DOM done in memory ? and How can firebug show 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-05-31T02:41:29+00:00Added an answer on May 31, 2026 at 2:41 am

    The source code never changes. When you “view source” that just shows you exactly what the browser received from the server.

    It is the DOM (Document Object Model) that you are manipulating, not the HTML.

    The initial DOM state is a representation of the source HTML, but it is not permanently linked with the source HTML. Javascript changes the DOM but not the HTML. See here for a full explanation of the DOM: http://www.w3.org/TR/DOM-Level-2-Core/introduction.html

    The Document Object Model (DOM) is an application programming
    interface (API) for valid HTML and well-formed XML documents. It
    defines the logical structure of documents and the way a document is
    accessed and manipulated.

    And a relevant quote from the page under the heading “What the DOM is not”:

    The Document Object Model is not a way of persisting objects to XML or
    HTML. Instead of specifying how objects may be represented in XML, the
    DOM specifies how XML and HTML documents are represented as objects,
    so that they may be used in object oriented programs.

    Firebug (and other developer tool frameworks), similarly, show you the current state of the DOM (because that’s what is dynamic). That’s why see the change in Firebug, but not in the source code view.

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

Sidebar

Related Questions

Hello guys on my blog I use this script: jQuery(document).ready(function () { jQuery(.postbox).hover(function ()
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
<script type=text/javascript> $(document).ready(function() { alert(Hello jQuery.); }); </script> This works the first time I
I have this jquery selector $('.accordion label').live('click',function() { alert(hello clicky clicky); } but if
Hello I have a jquery function called create time box This creates a textbox
Hello world. × jQuery $('#closeerrordiv').click(function() { $(this).parent().animate({opacity: 0}, 'slow', function() { $('#regWarnMsg').slideUp('slow'); }); });
hello frieds this is how i usually post a variable using Jquery.. $.post(include/save_legatee.inc.php, {
Hello I'm trying something .. I was reading Jquery traversing documentations some forums, this
How could I achieve the following: document.all.regTitle.innerHTML = 'Hello World'; Using jQuery where regTitle
Hello to all jQuery enthusiasts and experts!! I currently use on a project this

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.