Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Combine HTML tags with a DOM text node element?

Reply
Thread Tools

Combine HTML tags with a DOM text node element?

 
 
Robert Oschler
Guest
Posts: n/a
 
      08-29-2005
I have several text nodes that I create on the fly in my web page use
document.createTextNode().

Is there an easy way using DOM techniques to add formatting tags like <b>,
<H2>, etc. to my text node, without having to create extra nodes for every
little detail? Is there a better technique?

Thanks.


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-29-2005


Robert Oschler wrote:

> Is there an easy way using DOM techniques to add formatting tags like <b>,
> <H2>, etc. to my text node, without having to create extra nodes for every
> little detail? Is there a better technique?


If you are scripting HTML documents then most browsers around now
support the innerHTML property of elements to be set to a snippet of
HTML markup which the browser then parses and inserts as the content of
the element.
innerHTML is not a W3C DOM property but IE 4 introduced it and now
Mozilla, Opera, Safari, Konqueror do too.



--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find node in TreeView by using string(the same as Node.Text) ? jiing ASP .Net 0 04-27-2007 02:34 AM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
problem with child text node when constraining other child node types Bryan Ax XML 6 05-17-2006 09:08 PM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
[HELP] Create a DOM using a node from another node yio@free.fr Java 0 07-16-2003 12:30 PM



Advertisments