Okay
  Public Ticket #1297618
hide on noscript, display otherwise
Closed

Comments

  • PartuOnline started the conversation

    Simple question.

    How do I hide the large empty rectangle when the user has javascript turned off? 

    I tried using

    .ls-wp-container{display:none;} 

    which  hides the div

    and then this:

    document.getElementsByClassName("ls-wp-container").style.display = "block !important";

    But it doesn't display when it should.

    Help please.

    Thanks.

  • [deleted] replied

    Hey PartuOnline,

    There is an error in your code. The

    document.getElementsByClassName("ls-wp-container")

    function call returns an array, so you cannot use the style property, because it's only available for DOM nodes. In cases like this you would need to iterate through all the items in the array and set styles for the elements individually.

    For simpicity, I would recommend using this jQuery snippet, which makes this much easier:

    jQuery('.ls-wp-container').show()
  • PartuOnline replied

    Thanks!  That works perfectly. 

  • [deleted] replied

    Thank you for the feedback, glad you could solve the problem. If you need further assistance please let us know.