|
Joe
Best wishes
Rob
Joe Lee wrote:
The name attribute is not specified as an attribute for every element, and there may be problems with using it on every element in XHTML. I know that there are a few instances where it is specified, such as <a> anchor, <button>, and <input> elements. With the <input> elements the name attribute is necessary because it is used to identify the value when the form is submitted. However even when an element requires the name attribute, I would recommend also using the id attribute. However as Walden points out there may be a problem if the <input> tags are generated by WSG. Though in that case you could possibly do something like this:
function generateIdsForInputElements() { var inputs = document.getElementsByTagName("input"); var i =0; for (i=0:i <inputs.length:i++) { inputs(i).id = inputs(i).name; } }
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.