Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7855973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:32:45+00:00 2026-06-02T20:32:45+00:00

My HTML codes not implement the CSS styling..The border in the CSS file is

  • 0

My HTML codes not implement the CSS styling..The border in the CSS file is not being implemented.
I tried both in Firefox & IE. Please provide your inputs.

Please find the code below:

HTML

<html>
    <head>
        <link href="file://c:/jquery/chapter-1/begin/styles/my_style.css" rel="stylesheet"> 
    </head>
    <body>
        <div id="header" class="no_hover"><h1>Header</h1></div>
        <button type="button" id="btn1">Click to Add</button>
        <button type="button" id="btn2">Click to Remove</button>
        <script src="file://c:/jquery/chapter-1/begin/scripts/jquery.js"    type="text/javascript"></script>
        <script src="file://c:/jquery/chapter-1/begin/scripts/test4.js" type="text/javascript"></script>
    </body>
</html>

jS FILE

$(document).ready(function() {
    $("#btn1").click( function(){
        $("#header").addClass("hover");
        $("#header").removeClass("no_hover");
    });
    $("#btn2").click( function(){
        $("#header").removeClass("hover");
        $("#header").addClass("no_hover");
    });
});

CSS FILE

.hover{
    border: solid #f00 3px;
}
.no_hover{
    border: solid #000 3px;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:32:46+00:00Added an answer on June 2, 2026 at 8:32 pm

    Here is some code to help you with your jQuery or to clean it up. Don’t dive into the DOM multiply times. If you are then create a variable. Also you can chain your events. It looks like you are just starting jQuery so when you get more into it you will learn this. Hope this helps.

    JSFiddle

    $(document).ready(function() {
        var header = $("#header");
    
        $("#btn1").on("click", function() {
           header.addClass("hover").removeClass("no_hover");                      
        });
        $("#btn2").on("click", function() {
            header.removeClass("hover").addClass("no_hover");
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jquery.js source code is not being recognised by browser using my page.html served by
When I write client side code, I use HTML/CSS/JavaScript and lately jQuery to both
Why is my jQuery code not increasing the font size? <!DOCTYPE html PUBLIC -//W3C//DTD
I've looked at http://code.google.com/appengine/docs/java/urlfetch/overview.html but the code does not show a pooling example, i
not sure why I find this so difficult. Here is the html code: <tr>
http://code.google.com/appengine/docs/python/tools/uploadingdata.html is not clearly understand. Where i should call the bulkloader.py or appcfg.py? Should
Further to https://stackoverflow.com/questions/8990246/frame-like-in-html/8990407#8990407 I implemented floating divs in my JSP. It works properly in
I recently built an AIR app using HTML, CSS and JavaScript. In the web
I am trying to implement the following screen layout using a CSS grid framework
Consider this code : HTML: <div class='a'>a</div> <div class='b'>b</div> <div id='log'></div> CSS: .a, .b

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.