送信ボタンをグラフィカルなものに変更する

書式

sendButtonObj = new YAHOO.widget.Button(sendButtonID, option)

sendButtonObj : ボタンオブジェクト
sendButtonID : ボタンID
option : オプション【省略可能】

説明

送信ボタンをグラフィカルなものに変更するにはYAHOO.widget.Button()を使います。最初のパラメータに送信ボタンのIDを指定します。2番目のパラメータはオプションでクリック時の処理などを指定することができます。2番目のパラメータはオプションで省略することができます。

サンプルコード [実行]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" type="text/css" href="assets/button.css">
<script type="text/javascript" src="yahoo-dom-event.js"></script>
<script type="text/javascript" src="element-beta.js"></script>
<script type="text/javascript" src="button-beta.js"></script>
<script type="text/javascript"><!--
function message(p_oEvent) {
alert(this.get("id")+", "+p_oEvent);
}
new YAHOO.widget.Button("myButton", { id:"myButton01", onclick: { fn: message } });
// --></script>
</head>
<body>
<h1>Sample</h1>
<form>
<input type="submit" id="myButton" name="myButton" value="豪華な送信ボタン">
</form>
</body>
</html>