demoaddclass2.html 693 B

123456789101112131415161718192021222324252627282930313233
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>addClass demo</title>
  6. <style>
  7. div {
  8. background: white;
  9. }
  10. .red {
  11. background: red;
  12. }
  13. .red.green {
  14. background: green;
  15. }
  16. </style>
  17. <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
  18. <script src="demoaddclass2.js" type="application/javascript"></script>
  19. </head>
  20. <body>
  21. <div>This div should be white</div>
  22. <div class="red">This div will be green because it now has the "green" and "red" classes.
  23. It would be red if the addClass function failed.</div>
  24. <div>This div should be white</div>
  25. <p>There are zero green divs</p>
  26. <script>
  27. rtl.run();
  28. </script>
  29. </body>
  30. </html>