JS byClass不能通过索引获取其中的标签

通过getElementsByClassName方法获取到集合,其中也有数据,但是用索引取出其中的标签就取不出来,怎么获取到input标签?

img

img

img

document.querySelector(".bui-switch-input")

直接写 document.getElementByClassName('bui-switch-input')[0]