<form class="file" name="upload"> <input id="file" name="file"/> </form>
document.querySelectorAll('file')[0]
document.getElementById('file')[0]
document.getElementByTagName('file')[0]
document.getElementById('file')
A答案:document.querySelectorAll('#file')[0] B答案:document.getElementById('file') C答案:document.getElementsByTagName('input')[0]
document.getElementsByName()返回文档中具有给定名称的元素的Nodelist集合.
D获取的不是class为file 的第二个吗…
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题