Click here to Skip to main content
12,690,986 members (30,252 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET .NET C#4.0
i wrote following code

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

   $(document).ready(function () {
            $("button").click(function () {
<p class="test">This is another paragraph.</p>
 <asp:Button ID="button"  runat="server" Text="click" />

on runtime i am not getting output when i click button "This is another paragraph" should hide.
pls tell
Posted 23-Jan-13 2:49am
Updated 23-Jan-13 4:28am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

$(document).ready(function () {
            $("#button").click(function () {

try the above statement and it should work. Also make sure you have correct closing and starting tags as suggested by user : s_mon

In jquery if you are accessing control by ID then you should provide #YourControlID and
if you want to access by Class then you should write .YourControlClass.
Marcus Kramer 23-Jan-13 9:30am
+5. Good catch.
Member 9581488 23-Jan-13 9:32am
Thank you :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

p class="test">This is another paragraph.</p>... shouldn't this be <p class="test">This is another paragraph.</p>

and your tags are slightly muddled up... there's a closing </script> missing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170117.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100