Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Live typing

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34568
    dynamyc
    Member

    I’m trying to make something like this but instead of writing just one letter I want to be able to write 5 letters for example.
    Does anybody know how to achieve this ( I’m not insisting only on this example, if you know another examples let me know). I’m not very good at javascript, any hints will help me.
    Thanks!

    #88462
    dynamyc
    Member

    I’ve made something:











    But how can I make this work only with 2 words, for example google or yahoo?

    #88468
    jamygolden
    Member

    What about something like:

    $(document).ready(function() {
    $('div[contenteditable]').focus().keyup(function (e) {
    if(e.keyCode == 13) {
    var val = $(this).text();
    if(val == 'google' || val == 'yahoo') {
    document.location='http://www.' + $('div[contenteditable]').html() + '.com';
    }
    }
    });
    });
    #88481
    dynamyc
    Member

    It’s not working for me…
    also how can I make something like this: if is nothing typed in and the return(enter) is pressed to appear a alert or something like this…

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.