Input chrome扩展中的输入数组为空
我试着从网站上读取输入字段的值。但它显示它有值,但当我试图访问数组的字段时,它表示未定义 以下是content.js:Input chrome扩展中的输入数组为空,input,google-chrome-extension,content-script,Input,Google Chrome Extension,Content Script,我试着从网站上读取输入字段的值。但它显示它有值,但当我试图访问数组的字段时,它表示未定义 以下是content.js: const inputs=document.getElementsByTagName('input')) 控制台日志(输入); console.log(输入[0]); 我不知道是什么问题 这意味着页面将在以后动态添加它。使用setTimeout或MutationObserver。
const inputs=document.getElementsByTagName('input'))
控制台日志(输入);
console.log(输入[0]);
我不知道是什么问题
这意味着页面将在以后动态添加它。使用setTimeout或MutationObserver。