Suppose I have a radio button collection.
While I am selecting/deselecting certain options, Tick mark seems to be moving as well.
However if I see the HTML code, none of the options really show a “checked=true” in html.
1)So where is this information stored about my choices really ? DOM objects ?
Also using JS I change the checked attributes of DOM object- yet I dont see a change in HTML source of page. & I want this information to be present in HTML – coz I would be exporting pages in a way.
2)How do I use the Javascript to include “checked=true” in HTML itself ?
The HTML source is only the “blueprint” for the current page. The code gets loaded and parsed into DOM nodes, somewhere in the browser’s memory. When the page is displayed, things take place in the browser’s memory.
Therefore, dynamic changes will not automatically reflect to the default “view source” view in the browser.
Firebug’s source view can show dynamic changes to the DOM – it translates them back into HTML “live”. You won’t see form values there, though.
As @Daniel points out, the “view selection source” function in Firefox also shows a “live” view of the selected area.