Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Thursday, August 23, 2018

JQuery Interview Questions and answers

1.What are the basic selectors in jQuery?

Following are the basic selectors in jQuery:

A)Element ID
    A ID available the DOM Using ID we can axxess the control in JQuery.

using JQuery
$("#EmpId")

B)CSS Name
     A  class name will be available in the DOM usinf class name we can access this in JQuery.

using JQuery
$(".Menu")

C)Tag Name
    A tag name available in the DOM. For example $('a') selects anchor tags in the DOM.

using JQuery
$("a")

Tuesday, August 22, 2017

JQuery date picker in asp.net

Here am going to explained with an example , how to implement jQuery UI DatePicker Calendar with ASP.Net TextBox.
.aspx code
 <script src="../Scripts/jquery-1.12.4.min.js" type="text/javascript"></script>   
 <script src="../Scripts/jquery-ui-1.12.1.min.js" type="text/javascript"></script>  
 <link href="../Content/themes/base/jquery-ui.css" rel="stylesheet" rel="Stylesheet" type="text/css" />  
 <script type="text/javascript">  
   $(function () {  
     $("[id*=txtDate]").datepicker({  
       showOn: 'button',  
       buttonImageOnly: true,  
       buttonImage: 'images/calendar.png'  
     });  
   });  
 </script>  
  <div class="form-inline" role="form">  
    <div class="form-group">  
           <asp:TextBox ID="txtDate" runat="server" ReadOnly = "true"></asp:TextBox>  
           <asp:Button ID="btnSubmit" runat="server" Text="Submit"  
     onclick="btnSubmit_Click" />  
      </div>  
 </div