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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:59:05+00:00 2026-06-15T14:59:05+00:00

Outer, Inner and Filter are DIVs, Outer contains Inner and filter is independent. The

  • 0

Outer, Inner and Filter are DIVs, Outer contains Inner and filter is independent.

The button to execute the close function is located inside inner div. Onclicking the button, the function is not executed but when executed from the address bar, it executes

ie javascript:close(); executed in the address bar works fine. How to make this work, Whats the error ?? Have spent hours on this

<script type=text/javascript>
function close() {
  var x = document.getElementById("outer") ;
  var y = document.getElementById("inner") ;
  var z = document.getElementById("filter");    
  x.style.height = "0px" ;
  y.style.height = "0px";
  z.style.height = "0px";
  x.style.overflow = "hidden";
}
</script>

<div id="filter"></div>

<div id="outer"> 
  <div id="inner">
    <button onclick="close()">Close</button>
  </div>
</div>
  • 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-15T14:59:06+00:00Added an answer on June 15, 2026 at 2:59 pm

    It works now: http://jsfiddle.net/ckrxV/

    Problem was with the name “close” which is already defined in javascript

    function close1() {
    var x = document.getElementById('outer');
    var y = document.getElementById('inner');
    var z = document.getElementById('filter');
    alert('worked');
    x.style.height = "0px";
    y.style.height = "0px";
    z.style.height = "0px";
    x.style.overflow = "hidden";
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an outer div, and inside of that, I have an inner div
In parent: function outer(){ function inner(){ alert(hello); } } in iframe parent.outer.inner(); does not
I have outer div and inner div. I need to place inner div at
I can extend an inner class/trait inside the outer class or inside a class
I have an outer div that is 800px wide. I have an inner div
//html structure <div id='outer'> <div id='inner'> </div> </div> I am adding some data to
I have the following html code: <div class=outer ui-draggable style=position: relative;> <div class=inner>Foo bar</div>
I have two div's which looks like this <div id=outer> <div id=inner> </div> </div>
I've encountered a very strange bug: there's a div (#inner) placed inside an other
<div class=outer> <div class=inner></div> </div> how do I find the inner div here? $container.find('.outer

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.