@fayettec - If you're adding it in a wysiwyg, hubspot does some things to sanitize the html and maintain scopes of javascript (mostly seen in embed codes but, could be happening in this scenario as well). It's best to use the following code:
@fayettec - It would help to see the full JS error or a preview link to the page causing the issues. The error is probably unrelated to your original issue.
It does sound like you are trying to put the code in the the source code for a richtext area. I know that the rich text editor has rules for it's markup and will manipulate mark up to match those rules. <a> tags with out the "href" attribute are removed as well.
You can use jquery to insert the onlclick on page load like @tjoyce said, you can write an onclick function that targets a unique class on the button:
@fayettec - If you're adding it in a wysiwyg, hubspot does some things to sanitize the html and maintain scopes of javascript (mostly seen in embed codes but, could be happening in this scenario as well). It's best to use the following code: