asp.net - jQuery Not working in VS2010 -
hi new vs2010 , experimenting javascript in asp.net. have tried referencing sample scripts not working, why that?
<%@ page language="c#" autoeventwireup="true" codebehind="webform1.aspx.cs" inherits="member_supplier_details.webform1" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("button").click(function () { $("div").animate({ left: '250px' }); }); }); </script> <title>test</title> </head> <body> <form id="form1" runat="server"> <div> <button>start animation</button> <p>by default, html elements have static position, , cannot moved. manipulate position, remember first set css position property of element relative, fixed, or absolute!</p> <div style="background:#98bf21;height:100px;width:100px;position:absolute;"> </div> <!-- <input name="qty" type="text" id="text1" value="0" size="3" tabindex="2000" class="spinner" /> --> </div> </form> </body> </html>
change button code. becoz button without type submit page submited. change type button.
<button type="button">start animation</button>
Comments
Post a Comment