※ 引述《yaca (最近心情有點怪)》之銘言:
: 我利用生成子節點的觀念去做
: 但button 我還是不會做,指點一下吧
: 我附上我的程式碼
: ------------------------------------------------
: <script language="javascript">
: //新增子節點的函數
: function append_node(){
: var tnode1,tnode2,tnodebr;
: tnode1=document.createElement('INPUT TYPE=button');
'input'
tnode1.type='button';
: tnodebr=document.createElement("br");
: m1.appendChild(tnode1);
: m1.appendChild(tnodebr);
試試看:P
input系列的都是這樣搞,
包括button、reset、submit、text、password等等
不過會寫出底下這兩行莫名奇妙的code,(囧)
個人覺得您應該要把 dom 的觀念多看幾次.....|||
/*
var textnodex=document.createTextNode(t1.value);
tnode2=tnode1.appendChild(textnodex );
*/
────────────────────────────────
function append_node(){
var tnode1,tnode2,tnodebr;
tnode1=document.createElement('INPUT');
tnode1.type="button";
tnode1.value=t1.value;
tnodebr=document.createElement("br");
m1.appendChild(tnode1);
m1.appendChild(tnodebr);
}
btw
m1改成 document.getElementById('m1')會比較好 :)
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the complier will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.practice()); | Bone everything
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.27.68
※ 編輯: TonyQ 來自: 220.134.27.68 (01/20 20:23)