x
 
<!DOCTYPE html>
<html>
<body>
<h3>如何访问 HR 元素的演示</h3>
<hr id="myHR">
<p>单击按钮隐藏 HR 元素。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
  var x = document.getElementById("myHR");
  x.style.display = "none";
}
</script>
</body>
</html>