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

  • Home
  • SEARCH
  • 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 621727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:54:27+00:00 2026-05-13T18:54:27+00:00

I tried this: <div style=display:block;> <a href=/go style=display:block;height:100%;width:100%;position:absolute;></a> LOTS OF STUFF HERE <input type=button

  • 0

I tried this:

<div style="display:block;">
<a href="/go" style="display:block;height:100%;width:100%;position:absolute;"></a>
LOTS OF STUFF HERE 
<input type="button" onclick="runsomething();return false;">
</div>

But it doesn’t work. It does click to follow the anchor…but the button also follows anchor, which I don’t want.

Edit:The button won’t even click. It won’t press down! It’s like the Anchor completely covered it.

  • 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-13T18:54:28+00:00Added an answer on May 13, 2026 at 6:54 pm

    You can cause the event to cease propagation from the button on up so it never arrives at the DIV.

    $(".myDiv input").click(function(e){
      e.stopPropagation();
    });
    

    For more information on event.stopPropagation, see http://api.jquery.com/event.stopPropagation/

    For some reason, you have your anchor taking up the entire size of the parent container. Why? This will cover up your button, likely making it unclckable. I understand that you would like to make the entire DIV clickable, but this is the wrong approach. Consider the following:

    $(".myDiv").click(function(){
      window.location = $("a:first", this).attr("href");
    });
    

    This would cause a click on this DIV to send the user to wherever its link would have sent them. Best thing is you don’t need to add any CSS to your link, or DIV. Javascript will go and find the link within the div, get its href value, and send the user off in that direction.

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

Sidebar

Related Questions

I've tried this : <div id=xDiv align=left> <div id=divX runat=server style=margin-left:40px; width: 650px; align=center>
I tried using height: 100% but this makes the div only as high as
How to style each radio button? I have tried this: div.radio-toolbar {width:410px;} .radio-toolbar input[type=radio]
Here is the HTML <a style=border: medium none; display: block; class=agendaNav href=#><img class=rightArrow src=/images/arrowdown.png>
<style> *{ margin:0; padding:0; border:0; } #navlist{ display:block; width: 100%; float: left; list-style: none;
i've got this $('#div').attr(hidden, true); i tried: var a = $('#div').attr(hidden); var b =
I want align the div to center. like this I have tried margin-top, vertical-align
I tried this here: http://jsfiddle.net/92HXT/1/ but it does not work. It only works if
I tried what this said: How to style the UL list to a single
I have a the following HTML <a id=rptQuestions_ctl01_hlQuestion onclick=rptQuestions_ctl01_pnlAnswer.style.display = rptQuestions_ctl01_pnlAnswer.style.display == 'none'? 'block'

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.