Dwi Hyuga

Dwi Hyuga

  • NA
  • 116
  • 20.2k

Load elements can't process jquey function!!

Aug 5 2016 8:29 PM
  1. //first php
  2. <html>  
  3. <head>  
  4. <script>  
  5. $(document).ready(function (){  
  6. $("#red").load("http://localhost/pros/cons.php");  
  7. $("#blue").keypress(function(e){  
  8. if(e.which === 13){  
  9. alert("berhasil");  
  10. }  
  11. });  
  12. $("#green").keypress(function(e){  
  13. if(e.which === 13){  
  14. alert("OK");  
  15. }  
  16. });  
  17. });  
  18. </script>  
  19. </head>  
  20. <body>  
  21. <input id="blue" type="text"/>  
  22. <div id="red"></div>  
  23. </body>  
  24. </html>

  25. //cons.php

  26. <input type="text" id="green"/>

id="green" on cons.php on enter not work..


Answers (1)