Keyword highlighting in html Part One
Recently I posted about adding squiggly underlines to user-editable text in HTML.
By the end of the article we had nice squiggly lines appearing under text in a cross-browser way, falling back to a double underline if image borders weren’t supported. The “small” exercise left for the reader was to handle updating the text on the fly and restoring the caret position. I didn’t want to let on how much of a pain in the arse that can be! But since it is such a pain in the arse, I’m going to share the trials and tribulations with you, and by the end of this post we should have a nice working solution.
Categories: Development, Internet Tags: contenteditable, css, highlighting, input, javascript, styling, WYSIWYG