<html>
<?php foreach($array as $key => $val){ ?>
<input type="button" name="plan_bt[]" class="btn_gray" value="选择" >
<?php } ?>
<div class='print_button' style="position:absolute; margin:-45px 0 0 130px;">
<a href='javascript:void(0);' id="hideall">隐藏按钮</a>
</div>
</html>
<script>
$("#hideall").click(function(){
$("tr td input[name='plan_bt[]']").each(function() {
$(this).hide();
});
})
</script>
代码如上,这段代码在文件中执行不了,但是我放在F12
控制台哪里便可以执行,是什么原因呢?这段代码后面也有一些代码,那些代码是可以执行的,好像就只是绕过了这段代码一样