c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
JQuery

How to pick last character using jquery?

| | Html , JQuery

This article describes you to pick the last character using jquery. If someone inputs the textbox . From that input you want to pick the last character. You can get it by simply using jquery. Byusing slice keyword you can pick the last character. Here for example.

 Input:

infinetsoft.com

 

$(function () {

 
        $("#txtName").change(function () {

            var title = $('#txtName’).val();

            var lastChar = title.slice(-1);

            alert(lastChar);

        });

});

  

Output:

infinetsoft.co