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

<DIV> tag

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a


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

P: n/a
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.