Reputation: 63
I am working on a firefox plugin that uses firebreath framework. The plugin checks whether the firebreath dll is registered using the following code.
if(document.getElementByID("dllID").valid)
{
alert("Dll registered");
}
else
{
alert("Condition failed");
}
The code works fine for firefox upto version 28.
For higher versions the condition always fails. Can anyone help me in this??
Upvotes: 2
Views: 74
Reputation: 37328
Try .hasAttribute
, .getAttribute
, and .setAttribute
document.getElementByID("dllID").hasAttribute('valid')
Without these, is usually for XBL properties but things like id
work too.
Upvotes: 0
Reputation: 152
I've never heard of the valid
attribute. What are you trying to accomplish exactly? If it is for form validation, you probably need to deal with validation
objects https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation#The_HTML5_constraint_validation_API
if (document.getElementbyID("dllID").validity.valid){
...
} else {
....
}
Whats more, is this api seems to be present in FF29+ so it probably deprecated the plain valid
attribute you are used to
Upvotes: 1