...

View Full Version : this.select on pre?



zro@rtv
10-15-2006, 09:28 PM
So appearently I cannot use

onclick="this.select"
on any element other than textareas?

Any workaround to do this on a 'pre' tag?
or any feelings on this?
am i not thinking about this correctly?

cyber11
10-15-2006, 10:03 PM
What are you trying to do?

zro@rtv
10-15-2006, 10:20 PM
ya, sry... wasnt very specific.

http://r6.killerb.net/
thats the page im working on.

http://r6.killerb.net/js/clicks.js
is the js im using.

basically i have bunch of 'snippets', and i wanna have them highlight (for easy copying) when you click them.

Currently I hav jsut switched from pre to textarea, but it seems more semantically sound for them to be pre, but i guess its no big deal.

lemme kno what people think.

_Aerospace_Eng_
10-15-2006, 10:32 PM
Both text areas and pres keep their formatting. I would use a textarea for what you want to do. Only thing you might want to do is run the snippets through some server side script that converts < and > to html entities. Just make the textareas readonly so users can't accidently erase them.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum