導航:首頁 > 萬維百科 > 網頁設計如何在按鈕中添加事件

網頁設計如何在按鈕中添加事件

發布時間:2020-11-10 02:03:25

1、網頁設計中在頁面中加入個按鈕,在點擊按鈕的時候,頁面提示5次「hello Word」

這樣:
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function fun()
{
for (i=0; i<5; i++)
{
document.write("Hello World<br>");
}
}
</script>
</head>
<body>
<form action="">
<input type="submit" value="按鈕" onclick="fun()"/>
</form>
</body>
</html>

2、網頁製作中 當滑鼠放在button按鈕上時 按鈕顏色改變 如何實現?

插入代碼<button onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" >button</button>即可實現。

3、網頁設計,如何製作在點擊一個按鈕之後,才在一個div框中顯示文字圖片

對按鈕添加個onclick事件就行了,下面是個案例。

<div id="box"></div>
<button onclick="addContent()">按鈕</button>
<script>
function addContent(){
var oDiv=document.getElementById("box");
oDiv.innerHTML="這是添加的文字";
//oDiv.innerHTML='<img src="1.min.jpg"/>';   //添加圖片
}
</script>

4、怎樣在設計網頁中點擊某個按鈕,執行某個事件?

給你段關閉網頁的代碼做參考吧 </table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E5F6FF">
<tr>
<td height="80" align="center" class="morew" style="padding-left:30px; padding-right:30px">[ <a href="#" onClick="window.close()"><font color="#000000">關 閉</font></a> ]</td>
</tr>
</table> 可以把它插到<body>和</body>之間試下。

5、關於網頁製作:怎樣在網頁中點擊按鈕,然後彈出新窗口?

的window.open('page.html的','newwindow','高度= 100,寬= 400,= 0,左= 0時,工具欄=沒有,菜單=沒有,滾動條=沒有,可調整大小=沒有,位置=沒有狀態=沒有)

6、網頁設計如何點擊按鈕無限增加區塊

對按鈕添加個onclick事件就行了,下面是個案例。

7、網頁設計中怎麼對按鈕插入超鏈接

按鈕不支持加超鏈接,但是有方法讓你點擊按鈕後跳轉網頁
當前頁面打開

<input type=button onclick="window.location.href('連接')">
新窗口打開
<input type=button onclick="window.open('連接')">
建議使用其他行內標簽來做超鏈接 因為能用html實現,最好就不要用css,能用css實現的就不要用js

8、設計網頁點擊添加按鈕如何彈出對話框

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<style type="text/css">
<!--
td { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
.tx { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 20px; width: 40px; background-color: #eeeeee; cursor: hand}
.bt { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 60px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加公告</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 18px}
body {
background-color: #2286c2;
}
-->
</style>
</head>

<body>
<p class="STYLE1">公告標題:</p>
<form id="form1" name="form1" method="post" action="">
<label>
<input name="textfield" type="text" size="50" />
</label>
</form>
<p class="STYLE1">公告內容:</p>
<form id="form2" name="form2" method="post" action="">
<label>
<textarea name="textarea" cols="50" rows="20"></textarea>
</label>
<p>
<p><iframe frameborder="1" width="300" height="50" scrolling="no" src="upload.asp"></iframe></p>
</p>
</form>
<form id="form3" name="form3" method="post" action="">

<label> 
<input type="submit" name="Submit" value="提交" /> 
 
</label>
<input type="submit" name="Submit2" value="重置" />
</form>

<p> </p>
</body>
</html>

9、請問網頁製作中按鈕的製作

PS或coreldraw都可以,做成兩種樣式的,規格一樣,大小一樣,顏色變一下就可以,然後到dreamweaver中點編輯菜單有個插入-圖像對象-滑鼠經過圖像就可插入滑鼠經過以後的動態按鈕。

與網頁設計如何在按鈕中添加事件相關的知識