Web Analytics Made Easy -
StatCounter onClick Change the Height and Width to Fullscreen of DIV - CodingForum

Announcement

Collapse
No announcement yet.

onClick Change the Height and Width to Fullscreen of DIV

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • onClick Change the Height and Width to Fullscreen of DIV

    Hello My All Dear Friends!
    I am very new to java.And I need to a little thing with java I hope you awesome guys could do it.

    For example there is a div width some id.When I click some button it should be maximized to full screen with fixed position and 100% height and width.I have tried below code for this propose But it don't work for me in site..



    Code:
    <style>
    
    #someId {
    display: block;
    background-color: black;
    color: white;
    width: 100px;
    height: auto;
    }
    
    </style>
    
    <script type="text/javascript">
    function changeWidth(elemId, w){
         var elem = document.getElementById(elemId);
          elem.style.width = w;
    }
    </script>
    
    
    
    <input type="button" value=" Change Div Width " onclick="changeWidth('someId', 500);" />
    
    <input type="button" value=" Back To Orignal " onclick="changeWidth('someId', 100);" />
    
    <div id="someId">
    Div content.......
    
    </div>

    Please Help
    Thanks In Advance
    3
    left
    66.67%
    2
    right
    0.00%
    0
    left hideable
    33.33%
    1
    right hideable
    0.00%
    0
Working...
X
😀
🥰
🤢
😎
😡
👍
👎