-1
I want to do an extension for Chrome, the idea is to take a numeric value from inside a site, on its page and make count adding, subtracting, dividing and etc and then show the result next to the value as a little calculator I tried a few things and got by Id, but when the tag is a class I’m not getting:
here the manifest
{
    "manifest_version": 2,
    "version": "0.0.1",
    "name": "test calc",
    "description": "calc",
    "author": "LA",
    "browser_action": {
     "default_title": "Alterando valor",
     "default_popup": "index.html",
     "default_icon": "icon.png"
 },
 "content_scripts":[
 {
 "js": [ 
 "captura.js"
 ],
 "matches": [
 
 "https://sitequalquer/*"
 ]
 
 }
 
 ]
   
}
and here the javascript
var url = document.getElementById('Idtal').text;
alert(url);
var url = document.getElementsByClassName('classetal').innerText;
alert(url);
var url_ = document.getElementsByClassName('classetal')[0].innerHTML;
alert(url_);
var url_ = document.getElementsByClassName('classetal')[0].value + ",";
alert(url_);
another question is: after I need to use an operator with var and send by Alert, correct?
wow, thank you so much Felipe Chagas worked really well was that & #Xa;thank you really =D
– Agirl Ingame Youtuber
You’re welcome! If you killed the doubt, you can mark it as a solution, to close the question, please.
– Felipe Chagas