V24s

"Get Updates : Subscribe to our e-mail newsletter to receive updates........" "Good Luck frnds" Admission 2018 Application Form 2018 Colleges Entrance Exam 2018 Results 2018 Notification 2018 University Educational Jobs 2018 Government Jobs 2018

Search This Blog v24s guys

Follow by Email

15 April, 2013

jQuery- How to Set Cursor Position in Textbox in Asp.net

Introduction

Here I will explain how to set cursor position in textbox using 
jQuery in asp.net.

Description: 
   
In previous articles I explained jQuery Increase or Decrease font size of website, jQuery fadein fadeout effects Example, 
Redirect to another page after some time delay, jQuery slideUp slideDown toggle effectsand many articles relating to JQuery and asp.net. Now I will explain how to set cursor position in textbox using jQuery in asp.net

To implement this we need to write the following code in aspx page


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to set cursor position in textbox using jQuery in asp.net.</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#txtUserName').focus();
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<b>UserName:</b> <input type="text" id="txtUserName" /><br />
<b>Location:</b> <input type="text" id="txtLocation" /><br />
</div>
</form>
</body>
</html>
Live Demo

To check Live demo click on below button to set cursor position in UserName textbox 



UserName: 
Location:    
                   

Post a Comment
There was an error in this gadget

Popular Posts

Recent Posts

Google Analytics