Is it possible to get the value of a non-standard attribute in firefox?
I am trying to capture the value of attribute required. In IE I am able to get the value using document.form.required but in firefox it just returns undefined.

<html>
<head><title></title></head>
<body>
<form id="form" name="form">
<input type="text" name="txt" id="txt" value="val" required="1" />
</form>
</body>
</html>

Thanks in advance.

Is it possible to get the value of a non-standard attribute in firefox?
I am trying to capture the value of attribute required. In IE I am able to get the value using document.form.required but in firefox it just returns undefined.

<html>
<head><title></title></head>
<body>
<form id="form" name="form">
<input type="text" name="txt" id="txt" value="val" required="1" />
</form>
</body>
</html>

Thanks in advance.

Try this:

document.getElementById('txt').attributes['required'].value;


Regards...

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.