在JS中如何直接調(diào)用函數(shù),不使用alert彈框函數(shù)?
? ?<script type="text/javascript">
? ? ? function contxt() //定義函數(shù)
? ? ? {
? ? ? ? ?alert("哈哈,調(diào)用函數(shù)了!");
? ? ? }
? ?</script>
</head>
<body>
? ?<form>
? ? ? <input type="button"? value="點(diǎn)擊我" onclick="contxt()" />??
? ?</form>
</body>
2020-07-16
<script>函數(shù)名()</script>
2020-07-17
? ?謝謝老板
<script type="text/javascript">
? ? ? function contxt() //定義函數(shù)
? ? ? {
? ? ? ? ?document.write("哈哈,調(diào)用函數(shù)了!");
? ? ? }
? ?</script>
</head>
<body>
? ? ? <script>contxt()</script>?
</body>