So, I'm trying to improve accessibility in this dynamically generated form by setting up some tabindex. Once the user chooses a file type, it should set the tabindex to another button (which comes from another module, which I don't have access to:
$scope.setFileType = () ->
$scope.nextButton = document.getElementsByClassName("btn btn-default dropdown-toggle")
$scope.nextButton.tabIndex="400"
console.log($scope.nextButton)
$scope.$watch('reportTemplate.fileType'
(fileType) ->
return if not fileType
# some code
$scope.setFileType()
)
The console shows this message:
[button.btn.btn-default.dropdown-toggle, tabIndex: "400", item: function, namedItem: function]
0: button.btn.btn-default.dropdown-toggle
length: 1
tabIndex: "400"
__proto__: HTMLCollection
However, the tabindex doesn't change in the actual form. If I edit the button in the browser using the F12 command, it works as intended, which means I'm probably doing something wrong, perhaps the wrong scope.
What should I try next? Is this even the right approach to solve this issue?