hello everyone i try to make a bunch of text inputs to read Only or disabled using JavaScript i know you can do it with read Only attribute but i wanna do it with JavaScript .my problem is it doesn't work in an external JavaScript file but when i put it inside html file it works here is the code
var myInpts=document.querySelectorAll("input[type=text]");
for(var i=0;i<myInpts.length;i++)myInpts[i].disabled=true;
alert(myInpts.length);