|
|
| Can anyone tell me how do i place text within a "A" element created with document.createElement?? |
| create a text node, then append it to the element. |
| any examples?? |
| http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/ecma-script-language-binding.html has the API description |
| 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 |
| Don't know. I haven't worked with iframes for ... well, certainly I haven't this century. Far too troublesome. |
| do TextNodes support html?? like <br /> |
| Pure text It will output that as text |
| ovigo22_, how do I place a break between two text nodes?? |
| 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 |
| optomeb, ovigo22, thanks |