0

I am trying to get in the alert window the values of my class kreis attributes, but instead getting the background:#00FF00 and height:20px, the alert windows doesn´t prints anything, and I don´t know why. Thanks for your help in advance! Hereby the code:

<style>
#kreis{
    width:200px;
    height: 200px;
    border-radius:50%;
    background:#00FF00;
    top: 300px;
    text-align:center;
    display: inline-block;
    cursor:pointer;

}

</style>

<div onclick="Ball()" id="kreis"></div>

<script>
    function Ball() {
        alert("Hola");
        var style=document.getElementById("kreis").style;
        alert(style);
        alert(style.background);
        var color=style.height;
        alert(color); 
</script>

0 Answers0