I would like to execute function in chrome extension (in popup.js) by clicking on button in a innerHTML.
My code in popup.html is:
My code in popup.js :
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
if (msg.text === 'results') {
var panier_container = document.getElementById("panier_container");
var texte = "";
panier_container.innerHTML = texte;
});
});
function toto() {
alert("toto");
}
When I execute the code, I see the button "TOTO" but when I click on the button, nothing happen. Out of chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
the button execute the function. But inside no.
No comments:
Post a Comment