0

good day! when i click a button, this codes will be executed (tested, its working)

var cart=document.getElementById('cart');
cart.innerHTML=cart.innerHTML + document.getElementById('name'+cartNum).innerHTML + "(" + qty + ")" + "<br>";

this is the style of my cart

}
#cart {
    overflow:auto;
    border:solid;
    height:500;
    margin-left:10px;
    margin-right:10px;
    margin-top:20px;
    margin-bottom:0;
    font-size: 12px;
    text-align: left;
    font-family: Verdana, Geneva, sans-serif;
    background-image:url(images/side.gif);
    background-repeat:no-repeat;
}

my problem is, the overflow which i set to auto is not working. the div keeps on enlarging its height everytime i click the button. seems like it has a conflict with innerhtml? please help me. replies are REALLY appreciated.

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Graphix
0

You forgot to add the unit to the value and your CSS is not entirely correct, use the following:

#cart {
overflow:auto;
border:1px solid red;
height:500px;
margin-left:10px;
margin-right:10px;
margin-top:20px;
margin-bottom:0px;
font-size: 12px;
text-align: left;
font-family: Verdana, Geneva, sans-serif;
background-image:url('images/side.gif');
background-repeat:no-repeat;
}

~G

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.