I am trying to make a box pop up when i click on it. Here is the HTML for the boxes:
<div id="content_1">
<p>Hello</p>
<p>Please push the button</p>
<p><input type="button" id="go_button" value="Go"/> </p>
</div>
<div id="box">
<p>hello</p>
</div>
Here is the JavaScript and CSS:
$(document).ready(function() {
$("#content_2").on("click",function(){
.css("z-index",3);
}
}
Here is the styling just in case it’s needed:
#go_button {
}
#content_1 {
margin:20px auto;
position:fixed;
width:1000px;
text-align:center;
border:1px solid #d0d0d0;
box-shadow:1px 1px 5px #aaa;
border-radius:15px;
background:#99FF99;
z-index:3;
}
#box {
position:fixed;
top:100px;
left:300px;
z-index:1;
width:600px;
height:300px;
background:green;
}
body {
background:#f7f7f7;
}
It looks like you aren’t applying the css to anything:
Also,
#content_2isn’t defined.