Hi,

First post here and new to JS (first project in JS and first time I am writing a web application). So go easy on me if my question is dumb.

Here is what I am trying to do: Make a chrome extension that lets users rate suggested items from amazon.

I am trying to get the HTML code of the element the user clicks on. Parse that code, get some additional information, and send it along with the user rating.

Problem is that I don't exactly know how to get the HTML code of an element to parse it.

I added an onClick event but event.target does not work for me (not sure if this is supported by JS, but this is how I used to get event information in other languages).

Here is my code:

HTML Code:
.
.//some code here
.
function genericOnClick(event) 
{
      console.log(event.target);
}
.
.//some code here
.
var child1 = chrome.contextMenus.create
(
    {"title": "Rank 1", "contexts":["all"], "parentId": parent1, "onclick": genericOnClick}
);
.
.//some code here
.
Tried e.currentTarget.innerHTML and e.currentTarget.outterHTML. On both occasions I got an error. Though document.getElementsByTagName('html')[0].innerHTML works fine is error free. Any idea why I cannot use innerHTML from an event target?

Any help is appericated since I've been stuck on this for a while. Also if anyone here has some tips or that might help me in this project then please share.

Thank you