How can I hide text by accessing a class or CSS id?

        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript">
        $(document).ready(function(){
          $("span").click(function(){
            $(.comment).hide();
          });
        });
        </script>

       <a class=".comment">comment</a>'<br/><span class="comment">&bull;<a style="padding-left:3.5px;" href ="">Comment</a></span><form align="left" id="bring" action="profile.php" method="post" enctype="multipart/form-data" name="blab_from">
<textarea name="blab_field" rows="3" style="width:100%; height:30px;"></textarea>
 <input id="bringinput" name="submit" type="submit" value="submit" align="left" />
</form></td>

how can i hide the text & bull comment and make a form with this jquery?

+3
source share
3 answers

you have the wrong class definition in the tag (do not use a dot)

use this <a class="comment">comment</a>

0
source

Remove the period (.) In the class attribute, then try.

<a class="comment">comment</a>
+1
source

Try changing this:

<a class=".comment">comment</a>

:

<a class="comment">comment</a>

but keep javascript jQuery the same.

The dot before the comment tells jQuery to look for a class named comment, not .comment.

+1
source

All Articles