use-contenteditable.html 657 B

12345678910111213141516171819202122232425262728
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Contenteditable</title>
  6. <link rel="stylesheet" href="demo.css">
  7. </head>
  8. <body>
  9. <form id="form1" class="form" data-validator-option="{timely:2}">
  10. <div class="form-item">
  11. <div contenteditable id="email" data-rule="required;email"></div>
  12. </div>
  13. <div class="form-item">
  14. <button type="submit">Submit</button>
  15. </div>
  16. </form>
  17. <script src="https://cdn.jsdelivr.net/jquery/1.12.3/jquery.min.js"></script>
  18. <script src="../dist/jquery.validator.js?local=en"></script>
  19. <script>
  20. $('#form1').on('valid.form', function(){
  21. alert('ok')
  22. });
  23. </script>
  24. </body>
  25. </html>