| 팝업창을 띄워 사용자가 값을 입력할 수 있게 해주는 prompt 윈도우 메소드 |
예제2)
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko"lang="ko"> |
|
|
|
|
|
<head> |
|
|
<meta http-equiv="Content-Type"content="application/xhtml+xml; charset=UTF-8" /> |
|
|
<title> js의 기본 문서구조 </title> |
|
|
<meta name="Keywords" content="" /> |
|
|
<meta name="Description" content="" /> |
|
|
</head> |
|
|
<body> |
|
|
|
|
|
<p>test"1"</p> |
|
|
<p>test2</p> |
|
|
|
|
|
<script type="text/javascript"> |
|
|
//<!CDATA[ |
|
|
var name=prompt("당신이 좋아하는 연예인은",""); |
|
|
// prompt 윈도우 메소드이다. |
|
|
// ," " 에서 " " 안에는 기본값을 넣을 수 있다. |
|
|
|
|
|
document.write(name); |
|
|
//]]]]> |
|
|
</script> |
|
|
|
|
|
</body> |
|
|
</html> |
