Home

Javascript Style Change

I struggled with this. I wish to change the visibility in the instance using JS. What I missed was getComputedStyle  

      function ShowMessage(FromThis)
        {
            x = document.getElementById(FromThis)
            y = getComputedStyle(x)

            if(y.visibility === 'hidden')
                {
                x.style.visibility = 'visible'
                }
            else
                {
                x.style.visibility = 'hidden'
                }
        }

Reader's Comments

Post Your Comment Posts/Links Rules

Name

Comment

Add a RELEVANT link (not required)

Upload an image (not required)

No uploaded image
Real person number
Please enter the above number below




Home
Admin Ren's Biking Blog