[Phpwm] CSS highlighting

Phil Beynon phil at infolinkelectronics.co.uk
Thu May 10 18:16:47 BST 2007


another question......

Is there a way to use CSS & or javascript to highlight a text sub string, in
a similar way as setting the background colour via tags?

Obviously just in a bit of text printed on the screen its just a matter (as
a minimum effort) of wrapping it in a font tag background = whatever, but
I'm aiming to higlight pattern matched bits into and editable Iframe / text
editor GUI bit, so I don't want scatered remains of tags etc lurking in the
text should the user delete the highlighted bit.
Since the user could edit all or anything anything around the highlighted
bit it might be tricky to maintain exactly where any highlighting bits were
initially once the edited text is returned back to the server.

Something like a client side preg_replace() where the highlighting was
actually at a level where it was untouchable during editing really.

Phil




More information about the Phpwm mailing list