<DIV> tag switch-back-and-forth question

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

    <DIV> tag switch-back-and-forth question

    Hello! What is the best NS/IE compliant way to accomplish this using
    the least amount of javascript code?

    <div id="block1">
    Group 1 Code
    </div>

    <div id="block2">
    Group 2 Code
    </div>

    <a id="buttonone" href="javascrip t:somecode()">B utton One</a>
    <a id="buttontwo" href="javascrip t:somecode()">B utton Two</a>

    Ok, I know those <div> tags may not be formed correctly, but what I
    want is for 'Group 1 Code' to run by default, and then the user can
    click either button to execute the corresponding <div> tag.
  • Fabian

    #2
    Re: &lt;DIV&gt; tag switch-back-and-forth question

    Matthew hu kiteb:
    [color=blue]
    > Hello! What is the best NS/IE compliant way to accomplish this using
    > the least amount of javascript code?
    >
    > <div id="block1">
    > Group 1 Code
    > </div>
    >
    > <div id="block2">
    > Group 2 Code
    > </div>
    >
    > <a id="buttonone" href="javascrip t:somecode()">B utton One</a>
    > <a id="buttontwo" href="javascrip t:somecode()">B utton Two</a>
    >
    > Ok, I know those <div> tags may not be formed correctly, but what I
    > want is for 'Group 1 Code' to run by default, and then the user can
    > click either button to execute the corresponding <div> tag.[/color]

    What do you mean by execute? Conventionally, it is html that is
    contained within a div tag, and html is not known for its potential to
    be executed.


    --
    --
    Fabian
    Visit my website often and for long periods!
    AGAM69 menghadirkan inspirasi desain kreatif, solusi digital, pengembangan teknologi, serta inovasi modern untuk kebutuhan bisnis dan profesional.


    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: &lt;DIV&gt; tag switch-back-and-forth question

      mattsimc@yahoo. com (Matthew) writes:
      [color=blue]
      > Hello! What is the best NS/IE compliant way to accomplish this using
      > the least amount of javascript code?[/color]

      This? ... OH! The important part of your question was only in the
      subject. Don't do that! It makes your posting hard to read.
      [color=blue]
      > <div id="block1">
      > Group 1 Code
      > </div>
      >
      > <div id="block2">
      > Group 2 Code
      > </div>
      >
      > <a id="buttonone" href="javascrip t:somecode()">B utton One</a>[/color]

      <URL:http://jibbering.com/faq/#FAQ4_24>
      [color=blue]
      > <a id="buttontwo" href="javascrip t:somecode()">B utton Two</a>[/color]

      [color=blue]
      > Ok, I know those <div> tags may not be formed correctly, but what I
      > want is for 'Group 1 Code' to run by default, and then the user can
      > click either button to execute the corresponding <div> tag.[/color]

      The contents of DIV elements is HTML code. You don't execute that, you
      show it (it is a description language, not a programming language).

      Try to explain your problem more precisly. Ignore, for now, how you
      expect or want to solve it, just explain the problem. (E.g., "I want
      people to be able to select what happens when they <floodleboodl e> on
      the page. Either <foo> happens, or <bar> does. Selecting should be done
      by clicking in one of two places")

      (Then I would suggest to use buttons for the clickable places, not
      links, and for the rest, I would need to know what <floodlebodle >,
      <foo>, and <bar> are)

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      Working...