attr(“disabled”, false) causing error in Typescript

I have the following code in my ts file:

 $('input[type=hidden]').attr("disabled", false);

Code works but i am getting the following error:
Argument of type ‘false’ is not assignable to parameter of type ‘string | number | ((this: HTMLElement, index: number, attr: string) => string | number | void)’.

2 Answers

You should remove attribute altogether.


Try to pass false as string.

 $('input[type=hidden]').attr("disabled", "false");

Archive from:

Leave a Reply

Your email address will not be published. Required fields are marked *