By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

OnMouseOver question

P: n/a
Hi All,

I have some text on my page. This is normal text, not an anchor or
link or anything. I want to perform an action when the mouse moves
over it.

Can I to an onmouseover with simple text? If not, can I make an anchor
that goes nowhere so I can do the onmouseover????

Thanks,

Arthur

Jan 18 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
include your text in a <span> and do an onmouseover on it:

<span onmouseover="alert('it works')">my text</span>

Jan 18 '06 #2

P: n/a

Never saw that before........interesting......

Jan 18 '06 #3

P: n/a
<span> is a styleable DOM object, and it doesn't break the line as
<div> so you can use it inline whereever you want

Jan 18 '06 #4

P: n/a
impaler wrote:
<span> is a styleable DOM object,
`<span>' is the start tag of the `span' element which has the
`onmouseover' attribute. This does not have anything to do with
style(sheet)s, and a style would be applied to element, not to
the DOM object it is represented by.
and it doesn't break the line as <div>
`span' is by default an inline-level element, not by default a
block-level element such as the `div' element is. Therefore it
does not create a new block by default as the latter does.
so you can use it inline whereever you want


Wrong. A `span' element MUST NOT occur in a `textarea' element
in HTML 4.01/XHTML 1.0 Transitional, and it MUST NOT occur as
child element of the `body' element in HTML 4.01/XHTML 1.0 Strict,
for example.
PointedEars
Jan 18 '06 #5

P: n/a
Rather than having a popup, can I do one of those text annotations?
Similar to when you move over an icon in Windows, and it displays a
small text box telling you the file name, size, date of
creation..........

Jan 18 '06 #6

P: n/a
am****@iwc.net wrote:
Rather than having a popup, can I do one of those text annotations?
Similar to when you move over an icon in Windows, and it displays a
small text box telling you the file name, size, date of
creation..........


The `title' attribute can be used for this on most (X)HTML elements.
Anything more advanced requires either a positioned block element that
is showed by application of a CSS rule, or client-side script, creating
and manipulating the respective element via the DOM object it is
represented by.

Please read <URL:http://www.safalra.com/special/googlegroupsreply/>, as
this is implements the posting guidelines suggested by the newsgroup's
FAQ <URL:http://jibbering.com/faq/>.
PointedEars
Jan 18 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.