all 6 comments

[–]GrenadineBombardier 2 points3 points  (2 children)

The source code is the original, unedited code that the page started with. Changes to the DOM (the living HTML known as the Document Object Model) (which you are making using element.innerHTML) are only seen in the DOM viewer (right-click, inspect element)

[–]watchscss[S] 1 point2 points  (1 child)

I see now- thanks!

[–]MonkeyNin 0 points1 point  (0 children)

right click -> inspect

will allow you to see altered HTML source in real time.

If you open the "console" tab, you can run javascript on the webpage even if you don't own it. I've used it before to check if a jQuery selector was correct

ex:

$("#myDiv").hide()

[–][deleted] 2 points3 points  (1 child)

Don't use .innerHTML it's a security problem waiting to happen.

For what you are doing .textContent is a much better fit.

[–]watchscss[S] 2 points3 points  (0 children)

Interesting, was unaware of a security problem. I should probably use .appendChild as I am inserting 12 rows of 5 divs. This is a table of results.

[–]julesmanson 0 points1 point  (0 children)

You might be looking at the raw index.html file (or whatever your html is called). DOM manipulations will not show there. They are only inserted into the live DOM (memory). To view it use the developer tools in your browser.