locked
What is the equivalent in android to: if (img.currentStyle.display == 'none') in javascript RRS feed

  • Question

  • User-858993849 posted

    Using Javascript on android, How do I do the following?

    <script type="text/javascript" language="javascript">

    var img =document.getElementByID('image1');

    if (img.currentStyle.display == 'none')

    {

    img.style.display = 'inline';

    }

    </script>

     

     

    Sunday, September 25, 2011 7:35 PM

Answers

  • User1943143334 posted

    Hi,

    Try the following code!

    <script type="text/javascript" language="javascript">
     
    var img =document.getElementByID('image1');
     
    if (img.style.display == 'none')
     
    {
     
    img.style.display = 'inline';
     
    }
     
    </script>
    

    Hope it helps u...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 27, 2011 12:28 AM

All replies

  • User1943143334 posted

    Hi,

    Try the following code!

    <script type="text/javascript" language="javascript">
     
    var img =document.getElementByID('image1');
     
    if (img.style.display == 'none')
     
    {
     
    img.style.display = 'inline';
     
    }
     
    </script>
    

    Hope it helps u...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 27, 2011 12:28 AM
  • User-858993849 posted

    Thanks!

    I could swear I had tried thata  few years ago and had to use the .currentStyle to check.  Not sure what I was thinking!

    Thanks again

    Tuesday, September 27, 2011 7:26 AM