<DIV> tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chirs

    #1

    <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=pi peline.main">Pi peline</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
  • Martin Honnen

    #2
    Re: &lt;DIV&gt; tag



    chirs wrote:[color=blue]
    > 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=pi peline.main">Pi peline</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.[/color]

    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.g etAttribute('ta rget')
    respectively
    elementObject.t arget
    The first should work with Netscape 6/7, IE5+, Opera 7, the second with
    IE4+.

    --

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

    Comment

    • Evertjan.

      #3
      Re: &lt;DIV&gt; tag

      chirs wrote on 26 nov 2003 in comp.lang.javas cript:
      [color=blue]
      > 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=pi peline.main">Pi peline</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.
      >[/color]

      IE6, at least, will let you do this:

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

      <DIV class=Bar id=Bar1 menu="menu1" target='_top"'
      cmd="/app/login/ctrl.jsp?cmd=pi peline.main">Pi peline</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+"<b r>");

      </script>

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

      The id as globalised object is however not universal.

      btw: This will be only slightly usefull in IE:

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

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

      =============== ===========
      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)

      Comment

      Working...