Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I hide a text by referring to a CSS class or id?

Tags:

jquery

        <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 "&bull comment" text and make the form appear with that jquery?

like image 813
fello Avatar asked Dec 02 '25 06:12

fello


2 Answers

Remove dot(.) in class attribute and then try.

<a class="comment">comment</a>
like image 165
Karthik Avatar answered Dec 04 '25 20:12

Karthik


Try changing this:

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

to this:

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

but keep your jQuery javascript the same.

The dot in front of comment tells jQuery to look for a class named comment, not .comment.

like image 35
Brian Neal Avatar answered Dec 04 '25 20:12

Brian Neal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!