I have a checkbox I am trying to set and cannot seem to use "attr" or "prop" to check it.
This code will give me this error:
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'attr'
The element I am looking is valid.
If I comment out the ".attr" line and uncomment the ".checked" line, it works fine.
In other places I use attr to check the checkbox fine.
Why wouldn't this one work?
Thanks,
Tom
Code:
$(".btnInstructionsCheck").click(function () {
$(thisNotesButton).parents("tr")[0].firstElementChild.firstElementChild.attr("checked", "true");
//$(thisNotesButton).parents("tr")[0].firstElementChild.firstElementChild.checked = true;
})
This code will give me this error:
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'attr'
The element I am looking is valid.
If I comment out the ".attr" line and uncomment the ".checked" line, it works fine.
In other places I use attr to check the checkbox fine.
Why wouldn't this one work?
Thanks,
Tom