Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
hi,

 I am new to jquery. I am starting practicing. My first program to hide the paragraph i wrote the script but its not working. I am using master pages also here is my code.

master.aspx i kept js files.

<head runat="server">
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>


<title></title>

in Default.aspx

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
$('#paragraph').click(function () {
$('#paragraph').hide();
})
</script>
<p id="paragraph">This is a Pragraph.</p>
</asp:Content>



here the paragraph id is not getting hide. please help me thank you.
Posted

Check the url, you will find it interesting.
http://www.roseindia.net/tutorial/jquery/jqHideParaOnClick.html[^]

cheers
 
Share this answer
 
JavaScript
<script type="text/javascript">
$(document).ready(function(){
 $('#paragraph').click(function () {
  $('#paragraph').hide();
 });
});
</script>

Try this!
Hope it will help.
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900