不選取在光標處插入html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <head> <mce:script type="text/javascript"><!-- var ed = null; window.onload = function() { var o = document.getElementById("ss"); ed = document.all?o.contentWindow.document:o.contentDocument; ed.open(); ed.write('<html><head><mce:style><!-- html,body{margin:5px;font:14px;word-wrap:break-word} --></mce:style><style mce_bogus="1">html,body{margin:5px;font:14px;word-wrap:break-word}</style></head><body id="my_body"></body></html>'); ed.close(); ed.contentEditable = true; ed.designMode = 'on'; }; function ss(){ if(document.all) { document.getElementById("ss").contentWindow.focus(); var rang = ed.selection.createRange() rang.pasteHTML(rang.text+"<hr>"); } else { ed.execCommand("insertHTML",false,"<hr>");} } // --></mce:script> </head> <BODY> <input value="aaa" type="button" onClick="ss()"> <IFRAME id="ss" height="200" src="about:blank" mce_src="about:blank" width="200" ></IFRAME> </BODY></HTML>
使用CSS建站時,您肯定遇到過形形色色的佈局問題,最後可能被搞得焦頭爛額。本文的目的是讓您的設計過程更爲容易,當您遇到困難時爲您提供快速參考。 1、有疑問,先驗證 在調試時,先對您的代碼進行驗證往往能省去不少麻煩事。格式不正確的
createElement() //創建一個HTML元素 setAttribute() //設置一個屬性 appendChild() //向頁面或向某個元素裏添加元素 removeChild() //刪除元素 insertRow() //
方法 add 向 areas, controlRange 或 options 集合中添加一個元素。 add 創建一個新的 namespace 對象並將其添加到集合中。 addBehavior 給元素附加一個行爲。 AddChannel
<HTML> <HEAD> <title> </title> </HEAD><body><form id="form"><table id = "PrintA" width="100%" border="1" cellsp
前段時間支付寶賬單出現了新特效,就是下月賬單可以推送上月賬單的吸頂位置。 不多說上代碼: 首先:HTML <div class="list" v-for="item,index in 10"> <div class="lis