1. 程式人生 > 其它 >javascript當中prompt的用法

javascript當中prompt的用法

javascript當中prompt的用法

5.prompt

例 1.5(promptIEFF.html)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<style type="text/css">
#divTest{
background-color:#9F3;
/*沒有底下的margin為負,fireFox中老有個白邊*/
margin-top:-8px;
margin-left:-8px;
width:500px;
height:500px;
}
</style>
</head>
<body>
<div id="divTest">
body div
</div>
</body>
<script language="javascript" type="text/javascript">
/* 返回值:Property/method value type: String primitive
JavaScript syntax: - myResult = myWindow.prompt(aString, aDefaultValue)
- myResult = prompt(aString, aDefaultValue)
Argument list: aDefaultValue An initial content for the text box
aString Some text to explain what to enter

更多內容請見原文,文章轉載自:

https://blog.csdn.net/qq_43650923/article/details/103045943