Grow your CSS skills. Land your dream job.

jQuery typing detection

  • # June 1, 2012 at 2:50 pm

    Hi,

    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

    Ian

    # 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
    http://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_source_code_editors

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

    http://ace.ajax.org/

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".