»
Tiếng AnhTiếng PhápTiếng Việt

In - Nhập chữ vào trang web - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Ứng dụng » Công cụ xuất » Nhập chữ vào trang web
URL: https://www.javascriptbank.com/text-editor-script.html

Nhập chữ vào trang web © JavaScriptBank.comMột công cụ cho phép người dùng trực tiếp nhập chữ vào trang web với các thông số về kích thước, font...

Phiên bản đầy đủ: jsB@nk » Ứng dụng » Công cụ xuất » Nhập chữ vào trang web
URL: https://www.javascriptbank.com/text-editor-script.html



JavaScript
<script language="JavaScript"><!--// Based on 'Write in this page' scriptvar perm = false;function Write() { perm = !perm; Cur() }function Cur() {if (perm) { var cursor = document.a.cr[document.a.cr.options.selectedIndex].value; if (c.innerHTML != "") {c.innerHTML = ""} else { c.innerHTML = cursor } cursor = setTimeout("Cur()",550);} else { c.innerHTML = "" }}function Ins() {var key = event.keyCode;var txt = w.innerHTML;if (perm) { if (key == 13) {txt += "<br>"} else if (key == 8) { txt = txt.substring(0,txt.length-1) } else if (key == 32) {txt += "&nbsp;"} else if (key == 27) {txt = ""} else { txt += "&#" + key + ";"} w.innerHTML = txt; }}function See() {sd = toolbar.style.display;if (sd == "none") { sd = ""; document.a.see.value = "Hide toolbar" }else { sd = "none"; document.a.see.value = "Show toolbar" }toolbar.style.display = sd;}function Format() { w.style.fontStyle = "normal"; w.style.fontWeight = "normal" }// event.onAnyDoubt = [email protected]//--></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<h3 id="tit">The creator didn&#39;t know what to write in this page. Do you?</h3><form name="a"><q id="toolbar"><input type="text" value="Title" size="30" name="t"><input type="button" onclick="tit.innerHTML=t.value; this.blur()" value="Use title">&nbsp;&nbsp;<select onchange="if(document.a.what.options[a.what.options.selectedIndex].value=='text'){body.style.color=this.value}else{document.bgColor=this.value} this.blur()"><option value="white">White</option><option value="gray">Gray</option><option value="silver">Silver</option><option value="black">Black</option><option value="aqua">Aqua</option><option value="blue">Blue</option><option value="navy">Navy blue</option><option value="teal">Teal</option><option value="red">Red</option><option value="green">Green</option><option value="lime">Lime</option><option value="yellow">Yellow</option><option value="fuchsia">Fuchsia</option><option value="purple">Purple</option><option value="olive">Olive</option><option value="brown">Brown</option></select><select name="what"><option value="text">Text</option><option value="bg">Background</option></select><br><button name="b" onclick="Write();this.blur()"> <b>Write below</b> </button> <select onchange="w.style.fontSize=this.value; c.style.fontSize=this.value; this.blur()"><option value="xx-large">XX-Large</option><option value="x-large">X-Large</option><option value="large">Large</option><option value="medium">Medium</option><option selected="selected" value="small">Small</option><option value="x-small">X-Small</option><option value="xx-small">XX-Small</option></select> <input type="button" value="Italic" onclick="if(w.style.fontStyle=='normal'){w.style.fontStyle='italic'} else{w.style.fontStyle='normal'} this.blur()"><input type="button" value="Bold" onclick="if(w.style.fontWeight=='normal'){w.style.fontWeight='bold'} else{w.style.fontWeight='normal'} this.blur()">&nbsp;&nbsp; Cursor: <select name="cr" onchange="c.innerHTML = this.value; this.blur()"><option value="|">|</option><option value="_">_</option><option value="-">-</option><option value="/">/</option><option value="#">#</option><option value="!">!</option><option value="+">+</option><option value="*">*</option><option value="=">=</option><option value=";">;</option><option value="¦">¦</option><option value="´">´</option><option value="&quot;">&quot;</option><option value="§">§</option><option value="¤">¤</option></select></q><br><br><input type="button" name="see" onclick="See();this.blur()" value="Hide toolbar"><br><q id="w"></q><b id="c"></b></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->