tryit_view.asp@filename=trydhtml_form_bg_button

来自「W3Schools tutorial..web designing」· ASP@FILENAME=TRYDHTML_FORM_BG_BUTTON 代码 · 共 33 行

ASP@FILENAME=TRYDHTML_FORM_BG_BUTTON
33
字号
<html>
<head>
<script type="text/javascript">
function bgChange(bg)
{
document.getElementById('x').style.background="url(" + bg + ")";
}
</script>
</head>

<body>

<p>This example demonstrates how to insert a background image to a button</p>
<p>Mouse over these images and the button will get a background image.</p>

<table width="300" height="100">
 <tr>
  <td onmouseover="bgChange('paper.jpg')" 
      background="paper.jpg">
  </td>
  <td onmouseover="bgChange('bgdesert.jpg')" 
      background="bgdesert.jpg">
  </td>
</tr>
</table>

<form>
<input id="x" type="button" value="Mouse over the images">
</form>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?