<div class="h5-header">
<header class="m-header" style="display:block">
<a class="icon logo"></a>
<a href="#" class="title">标题</a>
<a href="javascript:void(0);" οnclick="change()" class="icon search"></a>
<a class="icon nologin"></a>
<a class="icon nav"></a>
</header>
<header class="x-search-panel" style="display:none">
<div class="x-search">
<div class="searchbox">
<form action="javascript:void(0);">
<input type="search" value="">
</form>
<a href="javascript:void(0);" οnclick="change()" class="cancle">取消</a>
</div>
</div>
<div class="toast">
</div>
</header>
</div>
<div style="height:199px;background-color:#eee;">占位</div>
<script type="text/javascript">
var header = document.getElementsByClassName("m-header")[0];
var search = document.getElementsByClassName('x-search-panel')[0];
function change() {
if (search.style.display == 'none') {
header.style.display = 'none';
search.style.display = 'block';
} else {
header.style.display = 'none';
}
}
</script>
我试了一下, 是因为你的输入法有问题, 我重新输入'click'就可以点击了


虽然长得一样, 但是本质是不同的