|
Revision 27754, 0.9 kB
(checked in by hoge1e3, 4 years ago)
|
|
初期インポート。
|
| Line | |
|---|
| 1 | <html>
|
|---|
| 2 | <head>
|
|---|
| 3 | <title>Tag Builder Test 2</title>
|
|---|
| 4 | <script src="prototype.js"></script>
|
|---|
| 5 | <script src="TagBuilder.class.js"></script>
|
|---|
| 6 | <script>
|
|---|
| 7 | var list;
|
|---|
| 8 | function exec() {
|
|---|
| 9 | $tag("button").target.disabled=true;
|
|---|
| 10 | $tag("body").add(["div",
|
|---|
| 11 | text=tag("input",{type:"text",onenter:add}),
|
|---|
| 12 | ["button",{onclick: insert}, "Insert"],
|
|---|
| 13 | ["button",{onclick: add}, "Add"],
|
|---|
| 14 | "(Or enter key)",
|
|---|
| 15 | ["br"],
|
|---|
| 16 | list=tag("div")
|
|---|
| 17 | ]);
|
|---|
| 18 | }
|
|---|
| 19 | function add() {
|
|---|
| 20 | list.add(create());
|
|---|
| 21 | }
|
|---|
| 22 | function insert() {
|
|---|
| 23 | list.insert(create());
|
|---|
| 24 | }
|
|---|
| 25 | function create() {
|
|---|
| 26 | var t;
|
|---|
| 27 | return t=tag("span",text.target.value,
|
|---|
| 28 | ["button",{onclick:rm},"Remove"],["br"]
|
|---|
| 29 | );
|
|---|
| 30 | function rm() {t.remove();}
|
|---|
| 31 | }
|
|---|
| 32 | </script>
|
|---|
| 33 | </head>
|
|---|
| 34 | <body id="body">
|
|---|
| 35 | <h1>Tag Builder Test 2</h1>
|
|---|
| 36 | <button id="button" onclick="exec()">Start</button>
|
|---|
| 37 | </body>
|
|---|
| 38 | </html> |
|---|