.addclass() doesn't work, but .removeclass() does? Missing something big?
Hi,
So when I use the following .js the .removeclass works, but not the add class. I think there may be something bigger I'm missing I'm not really sure. Any overall guidance would be great. Thanks
- $(document).ready(function() {
-
- $('.title').addClass('titletwo');
- $('.title').removeClass('title');
-
- });
Here is my .css and .html
- .para{
- background-color: aqua;
- }
- .title{
- background-color: green;
- }
- #header1{
- font-style: bold;
- }
- #para1{
- font-size: larger;
- }
- .titletwo{
- text-color: white;
- }
- <html>
- <header>
- <script src = "http://localhost:8888/ci/js/jquery.js"></script>
- <script src = "http://localhost:8888/ci/js/javatest.js"></script>
- <link rel="stylesheet" type="text/css" href="http://localhost:8888/ci/css/javatest.css" />
- </header>
- <body>
-
- <div class = "div" id = "div1">
- <h1 id = "header1" class = "title">This is a Header</h1>
- <p id = "para1" class = "para">This is the paragraph of the first div and header</p>
- </div>
- </body>
- </html>