页面中如果右其他的input就会报错。
$.each($("input"), function() {
if (this.getAttribute('data-show') == 'false') {
$(this).parent().find("ul").hide();
if ($(this).parent().find("ul").length > 0) {
$(this).prev()[0].setAttribute("style", 'transform:rotate(-90deg)');
} else {
$(this).prev()[0].setAttribute("style", 'opacity: 0;');
}
} else {
$(this).parent().find("ul").show();
if ($(this).parent().find("ul").length > 0) {
$(this).prev()[0].setAttribute("style", 'transform:rotate(0deg)'); // 这里报错
} else {
$(this).prev()[0].setAttribute("style", 'opacity: 0;'); // 这里报错
}
}
});