0

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.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by sasankasekhar
0

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...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.