hello,
im new to google chrome extensions and im trying to make a extensions that copy some words from the focused page then google it
here is what i ve done so far :

Code:
<html>
    <script>

        chrome.browserAction.onClicked.addListener(function(tab) {
            s = document.getElementsByClassName('no_copy term');
            a = s[0].innerHTML ;


            chrome.tabs.create({"url": "https://www.google.com/?q="+a,"selected":true});
        });
    </script>
</html>
And I am getting this error : "Error in event handler for 'browserAction.onClicked': Cannot read property 'innerHTML' of undefined TypeError: Cannot read property 'innerHTML' of undefined".

any idea?