insert_checkbox.html

来自「DHTML RichText editor for web developers」· HTML 代码 · 共 54 行

HTML
54
字号
<script>
function rteInsertHTML() {
	html = "<input type=\"checkbox\" name=\"" + document.getElementById("name").value + "\"";
	if (document.getElementById("checked").value != "") {
		html += " value=\"" + document.getElementById("checked").value + "\"";
	}
	if (document.getElementById("state").value != "") {
		html += " checked=\"" + document.getElementById("checked").value + "\"";
	}
	html += ">";
	window.opener.rteInsertHTML(html);
	window.close();
}
</script>
<style>
body, td {
background-color:#ECE9D8;
font-family:arial;
font-size:11px;
}
input {
font-family:arial;
font-size:11px;
}
select {
font-family:arial;
font-size:11px;
}
</style>
<fieldset>
<legend><b>Insert Checkbox</b></legend>
<table width="100%" cellspacing="2" cellpadding="0" border="0">
<tr>
<td align="right">Name: </td>
<td><input type="text" id="name" style="width:150px;"></td>
</tr>
<tr>
<td align="right">Checked Value: </td>
<td><input type="text" id="checked" style="width:150px;"></td>
</tr>
<tr>

  <td align="right">Initial State: </td>
  <td><select id="state">
    <option value="checked">Checked</option>
    <option selected="selected" value="">Unchecked</option>
  </select>
  </td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</table>
<div align="center"><input type="button" value="Insert Checkbox" onClick="rteInsertHTML();"></div>
</fieldset>

⌨️ 快捷键说明

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