473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Name attribute question

I have a few questions about the name attributes and href referencing
to. Can you declare name attributes for tags other than anchor
elements (like div or h2)? The validator keeps returning the following
error for HTML 4.0 strict .

Line 139, column 12: there is no attribute "NAME"

<h2 name="heading">H2 Headline </h2>

| You have used the attribute named above in your document, but the document type | you are using does not support that attribute for this element. This error is often
| caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>

<h2 name="heading">H2 Headline </h2>

So I made the changes and discovered that these changes did not
validate. This discovery happens after sometime away from the document
in question. Upon revisiting the document, the errors left me
perplexed and at odds. A quick Google search only led me to
descriptions about traditional anchors and the name attributes. These
results did not mention name attributes in other elements. Maybe, I
did not remember the correct term for hot links within a document.
Does anybody have any links that explain what I call hot links? Does
this scenario only occur in HTML 4.0 (and not xHTML)? Please give a
brief description of this topic if appropriate.

Jul 21 '05 #1
5 5728
Neville310 wrote:

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>
<h2 name="heading">H2 Headline </h2>

Use the "id" tag. The id value must be unique to validate.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #2
In message <ft********************************@4ax.com>, Neville310
<r0bert_neville@y.?.com.invalid> writes
I have a few questions about the name attributes and href referencing
to. Can you declare name attributes for tags other than anchor
elements (like div or h2)? The validator keeps returning the following
error for HTML 4.0 strict .

Line 139, column 12: there is no attribute "NAME"

<h2 name="heading">H2 Headline </h2>

| You have used the attribute named above in your document, but the
document type | you are using does not support that attribute for this
element. This error is often
| caused by incorrect use of the "Strict" document type with a document
that uses frames (e.g. you must use the "Transitional" document type to
get the "target" attribute), or by using vendor proprietary extensions
such as "marginheight" (this is usually fixed by using CSS to achieve
the desired effect instead).

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>

<h2 name="heading">H2 Headline </h2>

So I made the changes and discovered that these changes did not
validate. This discovery happens after sometime away from the document
in question. Upon revisiting the document, the errors left me
perplexed and at odds. A quick Google search only led me to
descriptions about traditional anchors and the name attributes. These
results did not mention name attributes in other elements. Maybe, I
did not remember the correct term for hot links within a document.
Does anybody have any links that explain what I call hot links? Does
this scenario only occur in HTML 4.0 (and not xHTML)? Please give a
brief description of this topic if appropriate.


<div style="width:100%;">
<h2 id="lab0"><a name="lab0">INTRODUCTION.</a></h2>
</div>
--
Jake
(ja**@gododdin.demon.co.uk .... just a spam trap.)

Jul 21 '05 #3
jake wrote:
<h2 id="lab0"><a name="lab0">INTRODUCTION.</a></h2>


Have a look at the illegal example in
<http://www.w3.org/TR/html4/struct/links.html#h-12.2.3>

xpost and f'up2 ciwah
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 21 '05 #4
Jim Moe wrote:
Neville310 wrote:

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>
<h2 name="heading">H2 Headline </h2>

Use the "id" tag. The id value must be unique to validate.

There's no such thing as an "id" tag. Have you ever seen <id> in an HTML
file?
Jul 21 '05 #5
Harlan Messinger wrote:

<a name="heading"></a>
<h2 name="heading">H2 Headline </h2>

Use the "id" tag. The id value must be unique to validate.

There's no such thing as an "id" tag. Have you ever seen <id> in an HTML
file?


<sigh>. Ya know, I had originally said "attribute" but then second
guessed myself by thinking about "tag soup" styling.
And mentioning that it is a attribute rather than a tag is more
informative than "Bzzt! Wrong!"

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter N. Schweitzer | last post by:
The function get_meta_tags reads a file or URL and returns an array, one element for each META tag in the HEAD element of the document. The keys of this array are the values of the name attribute...
9
by: aragon | last post by:
Hi all, is it legal to use a fully-numeric string as "name" attribute for the <select> tag in the XHTML standard? E.g.: <form action="action.php" method="get"> <select name="12345"> <option...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
6
by: Richard | last post by:
<a href="#" name="sample">link 1</a> <a href="#" name="sample">link 2</a> Would this be invalid use of the name? If I wanted to have a function that would be acted upon by detection of the...
10
by: Neville310 | last post by:
I have a few questions about the name attributes and href referencing to. Can you declare name attributes for tags other than anchor elements (like div or h2)? The validator keeps returning the...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
1
by: Simon Barnett | last post by:
Hi, RE: Converting pages including ASP pages for XHTML My question relates to ASP not ASP.NET - I can't find a newsgroup for ASP and hoped it was still relevant in ASP.NET - sorry if it's not....
24
by: Chameleon | last post by:
This code does not working in Mozilla. Works fine in IE. -------------- <input type=text value=100 name=textbox> <script> alert(textbox); </script> -------------- This perhaps, because of...
4
by: simon | last post by:
hi, I would like to separate my javascript completely from my xhtml. in the end there should be only <script type="text/javascript" src="javalib.js"></script> in the head-tag to my javascript....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.