http://www.w3schools.com/jsref/jsref_random.asp
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to display a random number.</p>
<button onclick="myFunction()">Try it</button>
<script type="text/javascript">
function myFunction()
{
document.getElementById("demo").innerHTML=Math.random();
}
</script>
</body>
</html>
Click the button to display a random number.
'Programming' 카테고리의 다른 글
(Javascript) how to display a message in console window? (0) | 2012.06.19 |
---|---|
(Javascript) is there a difference between <script language="javascript> and <script type="text/javascript"> (0) | 2012.06.18 |
(Visual Studio) Unable to find manifest signing certificate in the certificate store (0) | 2012.06.18 |
(Python) random.random() (0) | 2012.06.18 |
C++로 만든 코드 안드로이드로 마이그레이션 하기 (0) | 2012.06.17 |