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 ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…