0

Could someone help please

Igot something like

<div class="hidearea<?php echo $number?>">Example text Example text Example text Example text Example text </div>
<script> $( '.hidearea<?php echo $number?>' ).hide();  </script>

How to insert class from div into hide function as ?

3
  • do it on document ready Commented Nov 28, 2013 at 16:31
  • @SHIN Since his script is after the element, it should work as is. Commented Nov 28, 2013 at 16:32
  • What problem are you having with the code you wrote? I think it should work. Commented Nov 28, 2013 at 16:33

2 Answers 2

1

do some thing like this

$(function() {
    $( '.hidearea<?php echo $number?>' ).hide();
});

</script>
Sign up to request clarification or add additional context in comments.

Comments

0

Try this:

$(document).ready(function(e) {
    $( '.hidearea<?php echo $number; ?>' ).hide();
               // And don't forget ^ both times
});

NOTE: Shouldn't that be an ID instead of a CLASS? NOTE 2: Can't you just set display: none in your stylesheet?

Let me know if it's useful

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.