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 4612476
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:24:29+00:00 2026-05-22T01:24:29+00:00

I would like to add to my website possibilty to clear a div (delete

  • 0

I would like to add to my website possibilty to clear a div (delete all text).
A grey cross on the left fo the div, when you click, div is cleared. But when mouse is over, like on stackoverflow.com (in the comments), cross become red.
How can I do that ?

HTML :

print $cgi->div({-id=>"subheader"},$cgi->span({-id=>"reset"}));

CSS :

#subheader {
        text-align:center;
        clear: both;
        margin: 3px 0 10px 0;
        height:18px;
        background: #f4f4f4;
        color: #808080;
        border-bottom: 1px solid #ccc;
}

#reset {
        float:left;
        width:20px;
        height:20px;
}

Where do I put images ? in CGI or CSS ?
Thanks

For example with these images :close
black when mouse over, grey if not.

  • 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-05-22T01:24:29+00:00Added an answer on May 22, 2026 at 1:24 am

    Put the images in CSS:

    #reset {
        background:url('grey-cross.png');
    }
    #reset:hover {
        background:url('red-cross.png');
    }
    

    [EDIT]

    OP also asks how to make it a link so it works with JQuery.

    It doesn’t necessarily need to be a link element (ie an <a> tag) to work with JQuery; it can be any HTML element. You just need to put a click event onto it using JQuery:

    $('#reset').click(function() { ...your code here... }
    

    However, semantically, it’s best if you use an element type which is appropriate to the action it will perform, so I’d suggest making it a <button> or something similar. But the JQuery code is much the same whether it’s a <button> or a <div> or anything else.

    Hoep that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to add a button to my website so when people click
I am building a website and I would like to add a dark semi-transparent
net website, I would like to add button by which user can view the
I would like to add a GestureDetector to all views (view groups) of an
I would like to add value to my website that I have developed at
I would like to add a search/browse feature to my website. Users will be
I have a file upload form on my website and would like to add
I have a website written in ASP.NET. I would like to add subdomains of
I'm making a post page for my website, and I would like to add
I would like to add to my website some reporting using Google charts. The

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.