title: Chrome plugin - Contextmenu insert text
body: <p>I'm trying to figure out how to insert a predefined string on right clicking a input field (editable), usually i would use the document get element by id. However, since i have no way to determine what element a user clicks, on any website how do i go about doing this? </p>
  
  <p>so far i have my manifest file</p>
  
  <pre><code>"permissions": [
      "contextMenus",
      "background",
      "https://ajax.googleapis.com/"
  ],
  
  "background": {
      "scripts": ["scrippy.js"] 
  }
  }
  </code></pre>
  
  <p>(i have the rest of the required info as well.)</p>
  
  <p>And my script file </p>
  
  <pre><code>// Create context menu and set to only on inputs
  var type = ["editable"];
  var scrippyMenu = chrome.contextMenus.create({"title": "Scrippy", 
  "contexts": type});
  
  
  // menu context
  var menuContext = chrome.contextMenus.create({"title": "blabla", 
  "parentId": scrippyMenu, "contexts": type});
  
  var menuChild1 = chrome.contextMenus.create(
  {"title": "time", "parentId": menuContext, "contexts": type, "onclick": 
  genericOnClick});
  
  function genericOnClick(info, tab) {
  
  document.getElementById("Theunknownelement").textContent = 'This is added text';
  
  }
  </code></pre>