Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My script that is in html document
<head>
<script>

function gethistoryct()
{

alert('function verified');

}



the code to display an alert while clicking the submit button.
<label>
Get Data
<input type="submit" name="Submit" value="Submit"onclick="gethistoryct();" /> />
</label>



why isn't this working?

What I have tried:

onclick() doesnt seems to work.
Posted
Updated 5-Aug-16 1:33am
v2

1 solution

Chrome extension does not allow inline java script. To call the javascript on button click, you need to assign ID to your control (button) and through eventListner bind the click event. Also, separate your javascript method in .js file refer that in your html file.

For more detail go through the below article, this may help you to solve your problem:

Tech Community Helper: Chrome Extension : Create Chrome Extension and Call JS Method[^]

Thanks,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900