As pointed out by @NightOwlPrgmr, your selector is wrong. To fix this, you should use #call , not .call , as this is an identifier, not a class attribute. Also, the Document.ready function guarantees that your code will be launched after loading all html elements. This will reduce the risk of trying to use an item that has not yet been created. Example code similar to the above: -
<head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"> </script> </head> <body> <div> <form> <div class = "buttons"> <input type="submit" id="call" value="call"> </div> </form> </div> <script type="text/javascript"> </script> </body>
source share