Tag Id

Discussion in 'HTML' started by shapper, Dec 19, 2007.

  1. shapper

    shapper Guest

    Hello,

    When should I give an ID to a tag?
    Only if I want to refer it?

    And is there any type of tags that should always have an ID? Inputs
    for example?

    Thanks,
    Miguel
     
    shapper, Dec 19, 2007
    #1
    1. Advertising

  2. shapper

    rf Guest

    "shapper" <> wrote in message
    news:...
    > Hello,
    >
    > When should I give an ID to a tag?
    > Only if I want to refer it?
    >
    > And is there any type of tags that should always have an ID? Inputs
    > for example?


    http://www.w3.org/TR/html401/struct/global.html#adef-id

    --
    Richard.
     
    rf, Dec 19, 2007
    #2
    1. Advertising

  3. shapper

    dorayme Guest

    In article <IHhaj.25635$>,
    "rf" <> wrote:

    > "shapper" <> wrote in message
    > news:...
    > > Hello,
    > >
    > > When should I give an ID to a tag?
    > > Only if I want to refer it?
    > >
    > > And is there any type of tags that should always have an ID? Inputs
    > > for example?

    >
    > http://www.w3.org/TR/html401/struct/global.html#adef-id


    I wonder if OP reads posts on this group? There was a thread
    recently:

    http://tinyurl.com/2xfcmq

    or does he *just* use the ng to ask questions?

    (Am I being too unkind? Jukka refuses to come on and administer
    his bitter salts and now I realise there is something missing...
    <g>)

    --
    dorayme
     
    dorayme, Dec 19, 2007
    #3
  4. shapper

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article <IHhaj.25635$>,
    > "rf" <> wrote:
    >
    >> "shapper" <> wrote in message
    >> news:...
    >> > Hello,
    >> >
    >> > When should I give an ID to a tag?
    >> > Only if I want to refer it?
    >> >
    >> > And is there any type of tags that should always have an ID? Inputs
    >> > for example?

    >>
    >> http://www.w3.org/TR/html401/struct/global.html#adef-id

    >
    > I wonder if OP reads posts on this group? There was a thread
    > recently:
    >
    > http://tinyurl.com/2xfcmq
    >
    > or does he *just* use the ng to ask questions?


    Typical of google groupers. They don't know that google can also be used to
    <shudder>search</shudder> for stuff.

    Fishes and fishing come to mind.

    The required effect is for the OP to do some of his own homework :)

    --
    Richard.
     
    rf, Dec 19, 2007
    #4
  5. rf wrote:

    >
    > "shapper" <> wrote in message
    > news:...
    >> Hello,
    >>
    >> When should I give an ID to a tag?
    >> Only if I want to refer it?
    >>
    >> And is there any type of tags that should always have an ID? Inputs
    >> for example?

    >
    > http://www.w3.org/TR/html401/struct/global.html#adef-id


    Corollary question: what's the best -- id or name? Or does that just
    depend? If the latter, on what?

    --
    Blinky
    Killing all posts from Google Groups
    The Usenet Improvement Project - http://improve-usenet.org
     
    Blinky the Shark, Dec 20, 2007
    #5
  6. Gazing into my crystal ball I observed Blinky the Shark
    <> writing in
    news:p:

    > rf wrote:
    >
    >>
    >> "shapper" <> wrote in message
    >> news:a7ad3090-9d96-41c1-bbbd-


    >> ...
    >>> Hello,
    >>>
    >>> When should I give an ID to a tag?
    >>> Only if I want to refer it?
    >>>
    >>> And is there any type of tags that should always have an ID? Inputs
    >>> for example?

    >>
    >> http://www.w3.org/TR/html401/struct/global.html#adef-id

    >
    > Corollary question: what's the best -- id or name? Or does that just
    > depend? If the latter, on what?
    >


    In a form it makes a lot of difference.

    I can have:
    Which one does not belong?
    <input type="checkbox" id="field1" name="field" value="dog"> Dog
    <input type="checkbox" id="field2" name="field" value="cat"> Cat
    <input type="checkbox" id="field3" name="field" value="handbag"> Handbag

    I can get to the different radios using their id values. But if all are
    checked, then server side I will get field=dog, cat, handbag. Since
    handbag is not an animal, then I could style field3 to alert the user
    they had made a mistake.

    Further, id can be used on almost any element, where name can only be
    used on a few. I can put an id on a h2 element, but not a name, eg. <p>
    The one thing I enjoy shopping for most is <a href="page.html#shoes"
    title="Find out more about shoes">shoes</a>.</p> could go to <h2
    id="shoes">Shoes</h2>



    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Dec 20, 2007
    #6
  7. Adrienne Boswell wrote:

    > Gazing into my crystal ball I observed Blinky the Shark
    > <> writing in
    > news:p:
    >
    >> rf wrote:
    >>
    >>>
    >>> "shapper" <> wrote in message
    >>> news:a7ad3090-9d96-41c1-bbbd-

    >
    >>> ...
    >>>> Hello,
    >>>>
    >>>> When should I give an ID to a tag?
    >>>> Only if I want to refer it?
    >>>>
    >>>> And is there any type of tags that should always have an ID? Inputs
    >>>> for example?
    >>>
    >>> http://www.w3.org/TR/html401/struct/global.html#adef-id

    >>
    >> Corollary question: what's the best -- id or name? Or does that just
    >> depend? If the latter, on what?
    >>

    >
    > In a form it makes a lot of difference.
    >
    > I can have:
    > Which one does not belong?
    > <input type="checkbox" id="field1" name="field" value="dog"> Dog
    > <input type="checkbox" id="field2" name="field" value="cat"> Cat
    > <input type="checkbox" id="field3" name="field" value="handbag"> Handbag
    >
    > I can get to the different radios using their id values. But if all are
    > checked, then server side I will get field=dog, cat, handbag. Since
    > handbag is not an animal, then I could style field3 to alert the user
    > they had made a mistake.
    >
    > Further, id can be used on almost any element, where name can only be
    > used on a few. I can put an id on a h2 element, but not a name, eg. <p>
    > The one thing I enjoy shopping for most is <a href="page.html#shoes"
    > title="Find out more about shoes">shoes</a>.</p> could go to <h2
    > id="shoes">Shoes</h2>


    Ah! I did not know that name could not be used with some elements that
    accept id.

    Thanks, Adrienne.

    --
    Blinky
    Killing all posts from Google Groups
    The Usenet Improvement Project - http://improve-usenet.org
     
    Blinky the Shark, Dec 20, 2007
    #7
  8. Blinky the Shark wrote:
    > Adrienne Boswell wrote:
    >
    >> Gazing into my crystal ball I observed Blinky the Shark
    >> <> writing in
    >> news:p:
    >>
    >>> rf wrote:
    >>>
    >>>> "shapper" <> wrote in message
    >>>> news:a7ad3090-9d96-41c1-bbbd-

    >>
    >>>> ...
    >>>>> Hello,
    >>>>>
    >>>>> When should I give an ID to a tag?
    >>>>> Only if I want to refer it?
    >>>>>
    >>>>> And is there any type of tags that should always have an ID? Inputs
    >>>>> for example?
    >>>> http://www.w3.org/TR/html401/struct/global.html#adef-id
    >>> Corollary question: what's the best -- id or name? Or does that just
    >>> depend? If the latter, on what?
    >>>

    >> In a form it makes a lot of difference.
    >>
    >> I can have:
    >> Which one does not belong?
    >> <input type="checkbox" id="field1" name="field" value="dog"> Dog
    >> <input type="checkbox" id="field2" name="field" value="cat"> Cat
    >> <input type="checkbox" id="field3" name="field" value="handbag"> Handbag
    >>
    >> I can get to the different radios using their id values. But if all are
    >> checked, then server side I will get field=dog, cat, handbag. Since
    >> handbag is not an animal, then I could style field3 to alert the user
    >> they had made a mistake.
    >>
    >> Further, id can be used on almost any element, where name can only be
    >> used on a few. I can put an id on a h2 element, but not a name, eg. <p>
    >> The one thing I enjoy shopping for most is <a href="page.html#shoes"
    >> title="Find out more about shoes">shoes</a>.</p> could go to <h2
    >> id="shoes">Shoes</h2>

    >
    > Ah! I did not know that name could not be used with some elements that
    > accept id.


    http://www.w3.org/TR/html401/index/attributes.html
     
    Harlan Messinger, Dec 20, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jstack
    Replies:
    1
    Views:
    650
    Tor Iver Wilhelmsen
    Jul 4, 2003
  2. kishan bisht

    struts tag inside a tag

    kishan bisht, Jul 8, 2003, in forum: Java
    Replies:
    1
    Views:
    1,517
    Wendy S
    Jul 9, 2003
  3. shahbaz
    Replies:
    0
    Views:
    944
    shahbaz
    Oct 27, 2003
  4. RC
    Replies:
    2
    Views:
    457
    Malte
    May 10, 2005
  5. shruds
    Replies:
    1
    Views:
    962
    John C. Bollinger
    Jan 27, 2006
Loading...

Share This Page