5
Reply

jQuery Doesn't Work

Pankaj Kumar

Pankaj Kumar

Oct 5 2015 8:34 PM
379
My Code is Below.
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="JQuery/jquery-1.11.2.min.js"></script>
<script src="JQuery/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#btn").click(function () {
$("div").css("background-color", "red");
})
})
</script>
</head>
<body>
<form>
<div> This My Div and I want to change color of this div</div>
<button id="btn">Click</button>
</form>
</body>
</html>
 
 Problem with this code is : when i click on button then post back is occur and effect of jquery is remove
So please tell me what should i do to make jQuery Effect permanently
thanks in Advance  

Answers (5)