Hello,
I am trying to understand html's <label> attribute. According to http://www.w3.org/TR/html4/interact/forms.html#h-17.9
when I am using a single label for multiple elements I should use the following format: label for = idref [CS]. From what I understand [CS] represents names of the elements that I am labeling. But what is idref? What am I suppose to put there? Would someone kindly post a small example please?

Hello,
I am trying to understand html's <label> attribute. According to http://www.w3.org/TR/html4/interact/forms.html#h-17.9
when I am using a single label for multiple elements I should use the following format: label for = idref [CS]. From what I understand [CS] represents names of the elements that I am labeling. But what is idref? What am I suppose to put there? Would someone kindly post a small example please?

I don't believe labels can be used for multiple FORM elements.

The idref should be the value of the id attribute of the FORM element for which the label is for. The [CS] stands for Case Sensitive. Since IDs are CS also.

So a label can only be for a single element, since you cannot have two IDs of the same value in an XHTML document.

Thanks

Thanks

you're welcome. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.