我想在右侧显示中心文本和关闭按钮的进度条。 这段代码有效,但当我点击" x"关闭程序执行" hide()"功能(这是正确的)和" showSomething()"功能(不正确)。我怎样才能执行" hide()"功能点击" x"?
演示: https://jsfiddle.net/9razu5r1/
.progress {
text-align: center;
width: 200px;
margin: 15px auto;
}
.progress-value {
position: absolute;
right: 0;
left: 0;
}

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="progress" id=prog>
<span class="progress-value" onclick="showSomething()">Something 50%</span>
<div id="x" style="float: right;" onclick="hide('prog')">x</div>
<div class="progress-bar" style="width: 50%;"></div>
</div>
&#13;