Treehouse: Grow your CSS skills. Land your dream job.

jQuery typing detection

  • # June 1, 2012 at 2:50 pm


    I’m looking for some jquery code. What I want to achieve is when I’m typing in a textarea and I type

    I want it to automatically add the closing tag. Ideally this would work for any tag.

    I’m sorry not to have any code to start with but al my searches have drawn a blank and I’m not too hot with jquery. Anyway, thanks for any help


    # June 1, 2012 at 2:52 pm

    oops acidentally bolded everything. Should be “everytime i type < b >…” without the spaces

    # June 2, 2012 at 5:32 am

    Fixed up for ya

    I wouldn’t recommend starting from scratch with this, it would involve writing a regular expression for every type of html element which somehow ignores any attributes, I’m sure there’s plenty out there

    Here’s a list of editor available using JavaScript

    I’ve never used any of them myself but I’ve heard Ace is the best

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.