[jQuery] ATTR, strange behavior with "maxlength" in TEXTAREA
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,
i am trying to "normalize" the attribute "maxlength" (which is standard
to INPUTs) and create/add it explicitly to TEXTAREA in html:
<textarea id="test" maxlength="20">hi, everybody</textarea>
my problem:
<ul>
<li>$("textarea[maxlength]") doesn't work (find nothing) ???
</li>
<li>$("#test").attr("maxlength"), doesn't exist???</li>
<li>($("#test")[0].maxlength ||
$("#test")[0].getAttribute("maxlength")), works right
</li>
</ul>
Why the 2 first ways don't work? is this a normal behavior?
if I change the attribute name "maxlength" to another (no standard
attribute in any tag) name, such as "limitlength", then all of them
work.
thanx in advance,
<pre class="moz-signature" cols="72">--
Enrique Meléndez Estrada (2367)
Servicios Informáticos
Organización y Servicios Internos
Instituto Tecnológico de Aragón</pre>
</body>
</html>