0
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<style type="text/css">
#myDialog{
width:19%;
height:170px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
#hqalert{
width:100%;
height:30px;
background: -moz-linear-gradient(top, rgba(99,182,219,1) 29%, rgba(48,157,207,1) 52%);
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
</style>
<script type='text/javascript'>
function myinf(that)
{
if(that.value>15){
document.getElementById("myDialog").style.borderColor="#6EB6D5";
document.getElementById("myDialog").style.borderWidth="0.1px";
document.getElementById("myDialog").style.borderStyle="solid";
document.getElementById("myDialog").style.display='block';
}
}
</script>
</head>
<body>
<input type="text" onblur="myinf(this)" value="12" id="smps"/>
<input type="button" id="one"/>
<div id="myDialog" style="display:none;" ><p id="hqalert">General Alert:</p></div>
</body>
</html>
運行上述html時,會顯示警報。如果我們在文本框中輸入一個大於15的值,它可以正常工作,但警報在頂部有空白。我怎樣才能刪除它?頂部的空白區域