www.webdeveloper.com
Results 1 to 6 of 6

Thread: [RESOLVED] using enter like a onclick

  1. #1
    Join Date
    Jul 2013
    Posts
    21

    resolved [RESOLVED] using enter like a onclick

    i am making a text adventure game using html and javascript and i would like to have it so when you press enter after typing in the box it would do what this "send" button is doing now
    http://www.red566.nf/GuiTest/testlayout.html (i am mid way throw making it work with the gui at the time i post this)
    also it would be a grate if any one could help me with making the text box scroll down when new content is added

    ps if you would like to play the slightly more extended game (with out the gui)
    http://www.red566.nf/game.html

    thanks

    pps if you type Dbug 1-3 i have 3 levels of debugging (i need to make it better tho lvl 1 is functions, 2 ifs, 3 var values)
    Last edited by red566; 07-10-2013 at 07:47 PM. Reason: pps

  2. #2
    Join Date
    Jul 2013
    Posts
    21
    ppps the game only runs on firefox and google chrome right now

  3. #3
    Join Date
    Jul 2013
    Posts
    16
    Use the jquery library and you can do a keyup event handler. I believe the enter key registers as 13.

  4. #4
    Join Date
    Jul 2013
    Posts
    21
    can you give me an example ?

  5. #5
    Join Date
    Jul 2013
    Posts
    16

  6. #6
    Join Date
    Jul 2013
    Posts
    21
    YES that was so simple and needed no recoding thank you so much i will looking for days for that

    now the last thing left is having it scroll with new content

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles