Old 8th August 2008, 02:46   #1
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Another HTML question, is about <div>

Hi all:

I have this single line:
code:

<div onclick="somescript();">Hello World</div>


My problem is that when I click a few times the text is highlighted, like when you select it...is it possible to prevent this? Maybe some CSS or JS?
Thanks


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 8th August 2008, 03:35   #2
mikm
Major Dude
 
mikm's Avatar
 
Join Date: May 2001
Location: somewhere else
Posts: 1,255
Why are you using a div with onclick to do this? Why not use a button and use CSS to make it borderless instead?

powered by C₂H₅OH
mikm is offline   Reply With Quote
Old 8th August 2008, 04:10   #3
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Quote:
Originally posted by mikm
Why are you using a div with onclick to do this? Why not use a button and use CSS to make it borderless instead?
Nice idea....good point..thanks for the input


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 8th August 2008, 05:31   #4
Vil
Senior Member
 
Join Date: Jun 2006
Location: (-1)^(1/2)
Posts: 436
If there is plain text being displayed in any GUI browser I have used, you can select it. AFAIK, there is no way around that, so I think a button is your best bet if you want to make that not work.

present day present time
Vil is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Community Center > General Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump