Search code examples
htmlusabilityaccessibilitywikidokuwiki

HTML usability question - (double) clicking to select text


As you well know, double clicking on a word in a browser selects it, triple clicking selects the entire paragraph.

I'm tweaking a wiki, where signatures for anonymous users are created automatically and they look like:

--- // <ip.ad.dr.ess> //

The "---" generates a — , // is for italic text and generates <em></em>.

This is how it works now, as I tweaked it. Now I'm wondering about the usability.

My question is: how to generate the markup such that upon a double click on the ip address, the whole address and only the address will be selected?

The markup language doesn't matter, you may provide a solution in HTML, but one specific for wikis (dokuwiki) is preferable.

Thanks


Solution

  • Thanks to everyone, but I've managed to do it by using a readonly text field set without borders and with the background color of the background of the website.

    Double clicking works as expected, without relying on client-side scripting.