So I'm pretty new when it comes to java script and creating chrome extensions. So what I'm trying to do is to take two values which the user has inputted, add them together and display after the user has clicked calculate. However I can't seem to get it to work and I don't know what I'm doing wrong. I would greatly appreciate any assistance.
Here is my HTML code:
<!DOCTYPE html>
<html>
<head>
<h1>Simple Calculator</h1>
<script src="script.js"></script>
</head>
<body>
First Value<input type="text" id="ValueA"/><br>
Second Value<input type="text" id="ValueB"/><br>
Invested Cost<input type="text" id="result"/><br>
<button id="Calc;">Calculate</button>
</body>
</html>
My java script:
document.getElementById("Calc").addEventListener("click", Sum);
function Calc()
{
var A = document.getElementById('ValueA').value;
var B = document.getElementById('ValueB').value;
var C = A+B;
document.getElementById('result').value = C;
}
and finally my manifest:
{
"manifest_version": 2,
"name": "Simple Calculator",
"version": "1.0",
"description": "Simple Calculator",
"browser_action":{
"default_popup": "popup.html"
}
}