470,644 Members | 1,204 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,644 developers. It's quick & easy.

<DIV> tag

Hi,

What are the menu and cmd attributes in the following code? I could
not find the information for these two attributes to be used in a
<DIV> tag. Someone told me that you can define customised attribute
for <DIV> tag. Is that true? Thank you. Here is the code:

<DIV class=Bar id=Bar1 menu="menu1" target='_top"'
cmd="/app/login/ctrl.jsp?cmd=pipeline.main">Pipeline</DIV>

I found the target tag in O'Reilly book called Dynamic HTML The
Definitive Reference on Page 240. But I can't find it in www.w3c.org.

Chris
Jul 20 '05 #1
2 9433


chirs wrote:
What are the menu and cmd attributes in the following code? I could
not find the information for these two attributes to be used in a
<DIV> tag. Someone told me that you can define customised attribute
for <DIV> tag. Is that true? Thank you. Here is the code:

<DIV class=Bar id=Bar1 menu="menu1" target='_top"'
cmd="/app/login/ctrl.jsp?cmd=pipeline.main">Pipeline</DIV>

I found the target tag in O'Reilly book called Dynamic HTML The
Definitive Reference on Page 240. But I can't find it in www.w3c.org.


Those attributes are indeed not part of HTML 4's <div> element. Thus
they are custom attributes defined by the page author. Depending on the
browser you can read them as
elementObject.getAttribute('target')
respectively
elementObject.target
The first should work with Netscape 6/7, IE5+, Opera 7, the second with
IE4+.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
chirs wrote on 26 nov 2003 in comp.lang.javascript:
What are the menu and cmd attributes in the following code? I could
not find the information for these two attributes to be used in a
<DIV> tag. Someone told me that you can define customised attribute
for <DIV> tag. Is that true? Thank you. Here is the code:

<DIV class=Bar id=Bar1 menu="menu1" target='_top"'
cmd="/app/login/ctrl.jsp?cmd=pipeline.main">Pipeline</DIV>

I found the target tag in O'Reilly book called Dynamic HTML The
Definitive Reference on Page 240. But I can't find it in www.w3c.org.


IE6, at least, will let you do this:

=========================

<DIV class=Bar id=Bar1 menu="menu1" target='_top"'
cmd="/app/login/ctrl.jsp?cmd=pipeline.main">Pipeline</DIV>
<br>

<script>

document.write(Bar1.menu+"<br>");
document.write(Bar1.cmd+"<br>");
document.write(Bar1.className+"<br>");
document.write(Bar1.innerText+"<br>");
document.write(Bar1.target+"<br>");

</script>

==========================

The id as globalised object is however not universal.

btw: This will be only slightly usefull in IE:

==========================

<DIV
onclick='location.href=cmd'
cmd="http://cnn.com">
Pipeline</DIV>

==========================
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Paul Thompson | last post: by
8 posts views Thread by Daniel Hansen | last post: by
3 posts views Thread by Josef K. | last post: by
28 posts views Thread by Kent Feiler | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.