| View previous topic :: View next topic |
| Author |
Message |
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Can anyone tell me how do i place text within a "A" element created with document.createElement?? |
| |
|
|
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
| create a text node, then append it to the element. |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| any examples?? |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
| |
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
will this do:body=document.body;var link=document.createElement("a");link.setAttribute("href", "bla bla");var text = document.createTextNode("bla bla");body.appendChild(link);link.appendChild(text);
by the way is there a way to print the title of a page inside an iframe??
like frame_name.title |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
| Don't know. I haven't worked with iframes for ... well, certainly I haven't this century. Far too troublesome. |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
do TextNodes support html??
like <br /> |
| |
|
|
ovigo22
Joined: 15 May 2006 Posts: 130
|
Pure text
It will output that as text |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| ovigo22_, how do I place a break between two text nodes?? |
| |
|
|
ovigo22
Joined: 15 May 2006 Posts: 130
|
| CreateElement('br'); append a text node, append an HTML element node (of a br), append another text node. And it'll be 2 text nodes |
| |
|
|
| Page 1 of 2 |
Goto page 1, 2 Next |
|