Jquery On keyup function current character get [closed]Is there an “exists” function for jQuery?How can I upload files asynchronously?How do I check if an element is hidden in jQuery?var functionName = function() vs function functionName() Get current URL with jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?Get the current URL with JavaScript?“Thinking in AngularJS” if I have a jQuery background?Is it possible to apply CSS to half of a character?

How to increase row height of a table and vertically "align middle"?

Does restarting the SQL Services (on the machine) clear the server cache (for things like query plans and statistics)?

Why is the blank symbol not considered part of the input alphabet of a Turing machine?

How could a humanoid creature completely form within the span of 24 hours?

I want to write a blog post building upon someone else's paper, how can I properly cite/credit them?

My C Drive is full without reason

Clauses with 3 infinitives at the end

Musical Shape on music stand

What detail can Hubble see on Mars?

What does “two-bit (jerk)” mean?

Antivirus for Ubuntu 18.04

What did Varys actually mean?

Why was Gemini VIII terminated after recovering from the OAMS thruster failure?

All of my Firefox add-ons have been disabled suddenly, how can I re-enable them?

Why doesn't a particle exert force on itself?

When does WordPress.org notify sites of new version?

Is there any optimization for thread safety in for loop of Java?

Convert Numbers To Emoji Math

If an attacker targets a creature with the Sanctuary spell cast on them, but fails the Wisdom save, can they choose not to attack anyone else?

Picking a theme as a discovery writer

Which "exotic salt" can lower water's freezing point by 70 °C?

An adjective or a noun to describe a very small apartment / house etc

In the figure, a quarter circle, a semicircle and a circle are mutually tangent inside a square of side length 2. Find the radius of the circle.

How can I test a shell script in a "safe environment" to avoid harm to my computer?



Jquery On keyup function current character get [closed]


Is there an “exists” function for jQuery?How can I upload files asynchronously?How do I check if an element is hidden in jQuery?var functionName = function() vs function functionName() Get current URL with jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?Get the current URL with JavaScript?“Thinking in AngularJS” if I have a jQuery background?Is it possible to apply CSS to half of a character?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















i want to current keyup pressed value :



like my example: here alert in value="wj" and i want to j value it means current value pressed in input value get



alert("wj");


i want to get j
enter image description here










share|improve this question















closed as unclear what you're asking by lumio, Billal Begueradj, Matt Raines, Mark Rotteveel, Sovalina Mar 23 at 8:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















  • please explain your question i didnt get it

    – Haider Ali
    Mar 23 at 6:23











  • i have explain deeply in question

    – Rakesh Donga
    Mar 23 at 6:25











  • alert("j") - I don‘t get your question either. Give us some more code

    – lumio
    Mar 23 at 6:29

















-1















i want to current keyup pressed value :



like my example: here alert in value="wj" and i want to j value it means current value pressed in input value get



alert("wj");


i want to get j
enter image description here










share|improve this question















closed as unclear what you're asking by lumio, Billal Begueradj, Matt Raines, Mark Rotteveel, Sovalina Mar 23 at 8:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















  • please explain your question i didnt get it

    – Haider Ali
    Mar 23 at 6:23











  • i have explain deeply in question

    – Rakesh Donga
    Mar 23 at 6:25











  • alert("j") - I don‘t get your question either. Give us some more code

    – lumio
    Mar 23 at 6:29













-1












-1








-1








i want to current keyup pressed value :



like my example: here alert in value="wj" and i want to j value it means current value pressed in input value get



alert("wj");


i want to get j
enter image description here










share|improve this question
















i want to current keyup pressed value :



like my example: here alert in value="wj" and i want to j value it means current value pressed in input value get



alert("wj");


i want to get j
enter image description here







javascript jquery






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 6:30









lumio

5,14722239




5,14722239










asked Mar 23 at 6:19









Rakesh DongaRakesh Donga

1016




1016




closed as unclear what you're asking by lumio, Billal Begueradj, Matt Raines, Mark Rotteveel, Sovalina Mar 23 at 8:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as unclear what you're asking by lumio, Billal Begueradj, Matt Raines, Mark Rotteveel, Sovalina Mar 23 at 8:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • please explain your question i didnt get it

    – Haider Ali
    Mar 23 at 6:23











  • i have explain deeply in question

    – Rakesh Donga
    Mar 23 at 6:25











  • alert("j") - I don‘t get your question either. Give us some more code

    – lumio
    Mar 23 at 6:29

















  • please explain your question i didnt get it

    – Haider Ali
    Mar 23 at 6:23











  • i have explain deeply in question

    – Rakesh Donga
    Mar 23 at 6:25











  • alert("j") - I don‘t get your question either. Give us some more code

    – lumio
    Mar 23 at 6:29
















please explain your question i didnt get it

– Haider Ali
Mar 23 at 6:23





please explain your question i didnt get it

– Haider Ali
Mar 23 at 6:23













i have explain deeply in question

– Rakesh Donga
Mar 23 at 6:25





i have explain deeply in question

– Rakesh Donga
Mar 23 at 6:25













alert("j") - I don‘t get your question either. Give us some more code

– lumio
Mar 23 at 6:29





alert("j") - I don‘t get your question either. Give us some more code

– lumio
Mar 23 at 6:29












3 Answers
3






active

oldest

votes


















2














Try This






$('#txt').bind('keyup', function (event) 
//console.log(event.key);
var SecondVal=$(this).val().charAt(1)
if(SecondVal.trim()!='')
alert(SecondVal)
console.log(SecondVal);


);

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input id="txt">








share|improve this answer

























  • i want to get this value in variable how?

    – Rakesh Donga
    Mar 23 at 6:29











  • yes but my console in event is not defined error showing

    – Rakesh Donga
    Mar 23 at 6:31











  • @RakeshDonga : Are you include the jquery file ???

    – JIJOMON K.A
    Mar 23 at 6:32











  • yes i have allready included jquery

    – Rakesh Donga
    Mar 23 at 6:33











  • @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

    – JIJOMON K.A
    Mar 23 at 6:35


















0














var secletterval;
$(document).ready(function()
$("#address_field").keyup(event =>
secletterval = event.key;
alert(secletterval);
);
);


address_field is the id of your textbox






share|improve this answer

























  • but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

    – Rakesh Donga
    Mar 23 at 6:27











  • @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

    – Master Yoda
    Mar 23 at 6:34


















0














instead of keyup event use input event. This demo takes the text of a contenteditable <fieldset> and splits the text into an array of characters and uses .pop() to extract the last character.



Demo






$('.editor').on('input', edit);

function edit(e)
var tgt = $(e.target);
var key = tgt.next('.key');
var txt = tgt.text();
key.text(txt.split('').pop());

:root font: 400 16px/1 Consolas
.editor
min-height: 100px;
font: inherit;

.key
display:block;
text-align: center;
font: inherit;
font-size: 1.5rem;

<fieldset class='editor' contenteditable></fieldset>
<output class='key'></output>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>








share|improve this answer





























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Try This






    $('#txt').bind('keyup', function (event) 
    //console.log(event.key);
    var SecondVal=$(this).val().charAt(1)
    if(SecondVal.trim()!='')
    alert(SecondVal)
    console.log(SecondVal);


    );

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input id="txt">








    share|improve this answer

























    • i want to get this value in variable how?

      – Rakesh Donga
      Mar 23 at 6:29











    • yes but my console in event is not defined error showing

      – Rakesh Donga
      Mar 23 at 6:31











    • @RakeshDonga : Are you include the jquery file ???

      – JIJOMON K.A
      Mar 23 at 6:32











    • yes i have allready included jquery

      – Rakesh Donga
      Mar 23 at 6:33











    • @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

      – JIJOMON K.A
      Mar 23 at 6:35















    2














    Try This






    $('#txt').bind('keyup', function (event) 
    //console.log(event.key);
    var SecondVal=$(this).val().charAt(1)
    if(SecondVal.trim()!='')
    alert(SecondVal)
    console.log(SecondVal);


    );

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input id="txt">








    share|improve this answer

























    • i want to get this value in variable how?

      – Rakesh Donga
      Mar 23 at 6:29











    • yes but my console in event is not defined error showing

      – Rakesh Donga
      Mar 23 at 6:31











    • @RakeshDonga : Are you include the jquery file ???

      – JIJOMON K.A
      Mar 23 at 6:32











    • yes i have allready included jquery

      – Rakesh Donga
      Mar 23 at 6:33











    • @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

      – JIJOMON K.A
      Mar 23 at 6:35













    2












    2








    2







    Try This






    $('#txt').bind('keyup', function (event) 
    //console.log(event.key);
    var SecondVal=$(this).val().charAt(1)
    if(SecondVal.trim()!='')
    alert(SecondVal)
    console.log(SecondVal);


    );

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input id="txt">








    share|improve this answer















    Try This






    $('#txt').bind('keyup', function (event) 
    //console.log(event.key);
    var SecondVal=$(this).val().charAt(1)
    if(SecondVal.trim()!='')
    alert(SecondVal)
    console.log(SecondVal);


    );

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input id="txt">








    $('#txt').bind('keyup', function (event) 
    //console.log(event.key);
    var SecondVal=$(this).val().charAt(1)
    if(SecondVal.trim()!='')
    alert(SecondVal)
    console.log(SecondVal);


    );

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input id="txt">





    $('#txt').bind('keyup', function (event) 
    //console.log(event.key);
    var SecondVal=$(this).val().charAt(1)
    if(SecondVal.trim()!='')
    alert(SecondVal)
    console.log(SecondVal);


    );

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input id="txt">






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 23 at 6:45

























    answered Mar 23 at 6:25









    JIJOMON K.AJIJOMON K.A

    1,2481724




    1,2481724












    • i want to get this value in variable how?

      – Rakesh Donga
      Mar 23 at 6:29











    • yes but my console in event is not defined error showing

      – Rakesh Donga
      Mar 23 at 6:31











    • @RakeshDonga : Are you include the jquery file ???

      – JIJOMON K.A
      Mar 23 at 6:32











    • yes i have allready included jquery

      – Rakesh Donga
      Mar 23 at 6:33











    • @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

      – JIJOMON K.A
      Mar 23 at 6:35

















    • i want to get this value in variable how?

      – Rakesh Donga
      Mar 23 at 6:29











    • yes but my console in event is not defined error showing

      – Rakesh Donga
      Mar 23 at 6:31











    • @RakeshDonga : Are you include the jquery file ???

      – JIJOMON K.A
      Mar 23 at 6:32











    • yes i have allready included jquery

      – Rakesh Donga
      Mar 23 at 6:33











    • @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

      – JIJOMON K.A
      Mar 23 at 6:35
















    i want to get this value in variable how?

    – Rakesh Donga
    Mar 23 at 6:29





    i want to get this value in variable how?

    – Rakesh Donga
    Mar 23 at 6:29













    yes but my console in event is not defined error showing

    – Rakesh Donga
    Mar 23 at 6:31





    yes but my console in event is not defined error showing

    – Rakesh Donga
    Mar 23 at 6:31













    @RakeshDonga : Are you include the jquery file ???

    – JIJOMON K.A
    Mar 23 at 6:32





    @RakeshDonga : Are you include the jquery file ???

    – JIJOMON K.A
    Mar 23 at 6:32













    yes i have allready included jquery

    – Rakesh Donga
    Mar 23 at 6:33





    yes i have allready included jquery

    – Rakesh Donga
    Mar 23 at 6:33













    @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

    – JIJOMON K.A
    Mar 23 at 6:35





    @RakeshDonga : Updated my answer please check. replace function (e) with function (event)

    – JIJOMON K.A
    Mar 23 at 6:35













    0














    var secletterval;
    $(document).ready(function()
    $("#address_field").keyup(event =>
    secletterval = event.key;
    alert(secletterval);
    );
    );


    address_field is the id of your textbox






    share|improve this answer

























    • but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

      – Rakesh Donga
      Mar 23 at 6:27











    • @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

      – Master Yoda
      Mar 23 at 6:34















    0














    var secletterval;
    $(document).ready(function()
    $("#address_field").keyup(event =>
    secletterval = event.key;
    alert(secletterval);
    );
    );


    address_field is the id of your textbox






    share|improve this answer

























    • but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

      – Rakesh Donga
      Mar 23 at 6:27











    • @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

      – Master Yoda
      Mar 23 at 6:34













    0












    0








    0







    var secletterval;
    $(document).ready(function()
    $("#address_field").keyup(event =>
    secletterval = event.key;
    alert(secletterval);
    );
    );


    address_field is the id of your textbox






    share|improve this answer















    var secletterval;
    $(document).ready(function()
    $("#address_field").keyup(event =>
    secletterval = event.key;
    alert(secletterval);
    );
    );


    address_field is the id of your textbox







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 23 at 6:31

























    answered Mar 23 at 6:24









    Master YodaMaster Yoda

    501621




    501621












    • but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

      – Rakesh Donga
      Mar 23 at 6:27











    • @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

      – Master Yoda
      Mar 23 at 6:34

















    • but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

      – Rakesh Donga
      Mar 23 at 6:27











    • @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

      – Master Yoda
      Mar 23 at 6:34
















    but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

    – Rakesh Donga
    Mar 23 at 6:27





    but how can assign in any variable like var secletterval = jQuery('.custom-first').val()

    – Rakesh Donga
    Mar 23 at 6:27













    @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

    – Master Yoda
    Mar 23 at 6:34





    @RakeshDonga , i have updated my answer . Is it that you only wanna get the second key only , even when the user have enter any text in textbox .

    – Master Yoda
    Mar 23 at 6:34











    0














    instead of keyup event use input event. This demo takes the text of a contenteditable <fieldset> and splits the text into an array of characters and uses .pop() to extract the last character.



    Demo






    $('.editor').on('input', edit);

    function edit(e)
    var tgt = $(e.target);
    var key = tgt.next('.key');
    var txt = tgt.text();
    key.text(txt.split('').pop());

    :root font: 400 16px/1 Consolas
    .editor
    min-height: 100px;
    font: inherit;

    .key
    display:block;
    text-align: center;
    font: inherit;
    font-size: 1.5rem;

    <fieldset class='editor' contenteditable></fieldset>
    <output class='key'></output>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>








    share|improve this answer



























      0














      instead of keyup event use input event. This demo takes the text of a contenteditable <fieldset> and splits the text into an array of characters and uses .pop() to extract the last character.



      Demo






      $('.editor').on('input', edit);

      function edit(e)
      var tgt = $(e.target);
      var key = tgt.next('.key');
      var txt = tgt.text();
      key.text(txt.split('').pop());

      :root font: 400 16px/1 Consolas
      .editor
      min-height: 100px;
      font: inherit;

      .key
      display:block;
      text-align: center;
      font: inherit;
      font-size: 1.5rem;

      <fieldset class='editor' contenteditable></fieldset>
      <output class='key'></output>

      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>








      share|improve this answer

























        0












        0








        0







        instead of keyup event use input event. This demo takes the text of a contenteditable <fieldset> and splits the text into an array of characters and uses .pop() to extract the last character.



        Demo






        $('.editor').on('input', edit);

        function edit(e)
        var tgt = $(e.target);
        var key = tgt.next('.key');
        var txt = tgt.text();
        key.text(txt.split('').pop());

        :root font: 400 16px/1 Consolas
        .editor
        min-height: 100px;
        font: inherit;

        .key
        display:block;
        text-align: center;
        font: inherit;
        font-size: 1.5rem;

        <fieldset class='editor' contenteditable></fieldset>
        <output class='key'></output>

        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>








        share|improve this answer













        instead of keyup event use input event. This demo takes the text of a contenteditable <fieldset> and splits the text into an array of characters and uses .pop() to extract the last character.



        Demo






        $('.editor').on('input', edit);

        function edit(e)
        var tgt = $(e.target);
        var key = tgt.next('.key');
        var txt = tgt.text();
        key.text(txt.split('').pop());

        :root font: 400 16px/1 Consolas
        .editor
        min-height: 100px;
        font: inherit;

        .key
        display:block;
        text-align: center;
        font: inherit;
        font-size: 1.5rem;

        <fieldset class='editor' contenteditable></fieldset>
        <output class='key'></output>

        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>








        $('.editor').on('input', edit);

        function edit(e)
        var tgt = $(e.target);
        var key = tgt.next('.key');
        var txt = tgt.text();
        key.text(txt.split('').pop());

        :root font: 400 16px/1 Consolas
        .editor
        min-height: 100px;
        font: inherit;

        .key
        display:block;
        text-align: center;
        font: inherit;
        font-size: 1.5rem;

        <fieldset class='editor' contenteditable></fieldset>
        <output class='key'></output>

        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>





        $('.editor').on('input', edit);

        function edit(e)
        var tgt = $(e.target);
        var key = tgt.next('.key');
        var txt = tgt.text();
        key.text(txt.split('').pop());

        :root font: 400 16px/1 Consolas
        .editor
        min-height: 100px;
        font: inherit;

        .key
        display:block;
        text-align: center;
        font: inherit;
        font-size: 1.5rem;

        <fieldset class='editor' contenteditable></fieldset>
        <output class='key'></output>

        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 23 at 6:52









        zer00nezer00ne

        26.3k32547




        26.3k32547













            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript