<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://mg.to" xmlns:dc="https://purl.org/dc/elements/1.1/">
<channel>
 <title>mg.to - Easy DOM creation for jQuery and Prototype - Comments</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype</link>
 <description>Comments for &quot;Easy DOM creation for jQuery and Prototype&quot;</description>
 <language>en</language>
<item>
 <title>Notably missing is any</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-6218</link>
 <description>&lt;p&gt;Notably missing is any support for the &lt;code&gt;&amp;lt;EM&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;</description>
 <pubDate>Tue, 23 Oct 2012 11:06:04 +0000</pubDate>
 <dc:creator>lanzz</dc:creator>
 <guid isPermaLink="false">comment 6218 at https://mg.to</guid>
</item>
<item>
 <title>Thanks!</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-5055</link>
 <description>&lt;p&gt;Thanks for chasing that down, Vishakha. I assume this code replaces the &lt;code&gt;e = document.createElement( tag );&lt;/code&gt; in the original? I&amp;#8217;ll take a look at it and see if there is any way to simplify it, but it does sound like you&amp;#8217;re on the right track.&lt;/p&gt;

&lt;p&gt;Count on IE to make our lives more complicated! :-)&lt;/p&gt;</description>
 <pubDate>Thu, 16 Aug 2007 16:13:27 +0000</pubDate>
 <dc:creator>Michael Geary</dc:creator>
 <guid isPermaLink="false">comment 5055 at https://mg.to</guid>
</item>
<item>
 <title>This plugin is not working for IE</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-5054</link>
 <description>&lt;p&gt;Hi,
I found the work around for this issue. The issue is specific to creating elements in IE.
In IE you have to create radio buttons by using &lt;code&gt;document.createElement(&quot;&amp;lt;input name=&#039;myradio&#039; checked &amp;gt;&quot;)&lt;/code&gt; as the IE doesn&amp;#8217;t allow the name or many other attributes to be set on input elements. 
So for this I made following change in jquery-dom.js file to run it in IE also.&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// check for IE &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;document.&lt;span style=&quot;color: #006600;&quot;&gt;all&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;tag == &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;input&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; a;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; checked = &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; attr &lt;span style=&quot;color: #C00000;&quot;&gt;in&lt;/span&gt; attrs &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attr == &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a = attrs&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;attr&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attr == &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;checked&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checked = attrs&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;attr&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; input_text = &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;lt;input name=&amp;quot;&#039;&lt;/span&gt; + a + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;quot;&#039;&lt;/span&gt; + checked +&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039; &amp;gt;&#039;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e = document.&lt;span style=&quot;color: #006600;&quot;&gt;createElement&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;input_text&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #C00000;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e = document.&lt;span style=&quot;color: #006600;&quot;&gt;createElement&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tag &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #C00000;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e = document.&lt;span style=&quot;color: #006600;&quot;&gt;createElement&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tag &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this correct solution?  Please suggest me if you have some better solution for the above issue. &lt;/p&gt;

&lt;p&gt;&amp;#8212;Vishakha&lt;/p&gt;</description>
 <pubDate>Thu, 16 Aug 2007 12:14:00 +0000</pubDate>
 <dc:creator>Vishakha</dc:creator>
 <guid isPermaLink="false">comment 5054 at https://mg.to</guid>
</item>
<item>
 <title>This plugin is not working</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-4875</link>
 <description>&lt;p&gt;This plugin is not working with IE for creating radio buttons.&lt;br /&gt;
It creates radio buttons but we can&amp;#8217;t select that radio buttons. Is there any solution to solve this problem?&lt;/p&gt;</description>
 <pubDate>Fri, 06 Jul 2007 05:15:40 +0000</pubDate>
 <dc:creator>Vishakha</dc:creator>
 <guid isPermaLink="false">comment 4875 at https://mg.to</guid>
</item>
<item>
 <title>functions</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-3209</link>
 <description>&lt;p&gt;&lt;a href=&quot;https://blog.whats-your.name/post/2007/03/21/unified-DOM-creation-and-event-binding&quot;&gt;ive taken it further, to complete programmatic view and behavior definition.. &lt;/a&gt; cheers&lt;/p&gt;</description>
 <pubDate>Wed, 21 Mar 2007 21:54:59 +0000</pubDate>
 <dc:creator>carmen</dc:creator>
 <guid isPermaLink="false">comment 3209 at https://mg.to</guid>
</item>
<item>
 <title>cl-who style</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-2785</link>
 <description>&lt;p&gt;Here&amp;#8217;s how I&amp;#8217;d generate the same html table. It might seems more natural to &amp;#8220;certain&amp;#8221; people :-)&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;$.&lt;span style=&quot;color: #006600;&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;table&quot;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;MyTable&#039;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;tbody&quot;&lt;/span&gt;, &lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;tr&quot;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;MyTableRow&#039;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;td&quot;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;MyTableCol1&#039;&lt;/span&gt; , &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;howdy&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;td&quot;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;MyTableCol2&#039;&lt;/span&gt; , &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;Link: &quot;&lt;/span&gt;, &lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;a&quot;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;MyLink&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;href&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;https://www.example.com&#039;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;example.com&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://www.talrasha.com/jquery/jquery.easydom.js&quot;&gt;https://www.talrasha.com/jquery/jquery.easydom.js&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Mon, 26 Feb 2007 02:21:00 +0000</pubDate>
 <dc:creator>mac</dc:creator>
 <guid isPermaLink="false">comment 2785 at https://mg.to</guid>
</item>
<item>
 <title>Easier way to include inline styles</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-2615</link>
 <description>&lt;p&gt;Probably easier to use an object for the style and take advantage of JQuery:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; ez_clearer = $.&lt;span style=&quot;color: #006600;&quot;&gt;DIV&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;style: &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;clear: &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;left&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with this code (using a variation of the the &amp;#8220;ultimate fix&amp;#8221; above):&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attr == &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;style&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;
&amp;nbsp; $&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attrs&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;attr&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #C00000;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; $&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attr, attrs&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;attr&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or, even easier (skip the whole &lt;code&gt;for (var attr in attrs)&lt;/code&gt; loop:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; $&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attrs&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attrs.&lt;span style=&quot;color: #006600;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; $&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;attrs.&lt;span style=&quot;color: #006600;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 13 Feb 2007 17:58:36 +0000</pubDate>
 <dc:creator>D Wachsstock</dc:creator>
 <guid isPermaLink="false">comment 2615 at https://mg.to</guid>
</item>
<item>
 <title>Is download script updated?</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-2139</link>
 <description>&lt;p&gt;After looking at JS, I followed bellow given comments. I think there are lots of updates (fix) that should be available in download able JS file.
Right now I feel after download JS, I have to follow the thread and update script. Can anybody please post latest script!&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
 <pubDate>Tue, 26 Dec 2006 13:39:58 +0000</pubDate>
 <dc:creator>Ashish Agrawal</dc:creator>
 <guid isPermaLink="false">comment 2139 at https://mg.to</guid>
</item>
<item>
 <title>Use cellSpacing and cellPadding</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-963</link>
 <description>&lt;p&gt;There are some attributes that are capitalized differently in the DOM vs. HTML. If you use &lt;a href=&quot;https://msdn.microsoft.com/workshop/author/dhtml/reference/properties/cellspacing.asp&quot;&gt;cellSpacing&lt;/a&gt; and &lt;a href=&quot;https://msdn.microsoft.com/workshop/author/dhtml/reference/properties/cellpadding.asp&quot;&gt;cellPadding&lt;/a&gt; it should work OK.&lt;/p&gt;</description>
 <pubDate>Tue, 21 Nov 2006 22:45:28 +0000</pubDate>
 <dc:creator>Michael Geary</dc:creator>
 <guid isPermaLink="false">comment 963 at https://mg.to</guid>
</item>
<item>
 <title>Cellspacing and cellpadding</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-962</link>
 <description>&lt;p&gt;Hi I tried attributes cellspacing and cellpadding and they are not working/visible in DOM.&lt;/p&gt;</description>
 <pubDate>Tue, 21 Nov 2006 21:51:22 +0000</pubDate>
 <dc:creator>Aleksandar Pavic</dc:creator>
 <guid isPermaLink="false">comment 962 at https://mg.to</guid>
</item>
<item>
 <title>Please provide a working example</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-773</link>
 <description>&lt;p&gt;Please provide a link to a working example for this.&lt;/p&gt;</description>
 <pubDate>Thu, 02 Nov 2006 05:48:20 +0000</pubDate>
 <dc:creator>s</dc:creator>
 <guid isPermaLink="false">comment 773 at https://mg.to</guid>
</item>
<item>
 <title>Optional Args</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-464</link>
 <description>&lt;p&gt;This is a fix that allows the attr ({}) to be optional without requiring the first arg to be a string.&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #C00000;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;args&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; == &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;string&#039;&lt;/span&gt; || args&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;nodeType&lt;/span&gt; == &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; newArgs = &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;i=&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;; i &amp;lt; args.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;; i++&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; newArgs.&lt;span style=&quot;color: #006600;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;args&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; args = newArgs;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 04 Oct 2006 17:38:55 +0000</pubDate>
 <dc:creator>Demis Bellot</dc:creator>
 <guid isPermaLink="false">comment 464 at https://mg.to</guid>
</item>
<item>
 <title>RE: Question about the patch</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-396</link>
 <description>&lt;p&gt;So I had to actually change the above line once again so that it would work for none DOM nodes.&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;arg.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; arg = arg.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason this is necessary is because each $.[tagName] returns a jQuery object.&lt;/p&gt;</description>
 <pubDate>Mon, 18 Sep 2006 14:56:36 +0000</pubDate>
 <dc:creator>Brandon Aaron</dc:creator>
 <guid isPermaLink="false">comment 396 at https://mg.to</guid>
</item>
<item>
 <title>RE: Question about the patch</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-299</link>
 <description>&lt;p&gt;You know I had the same question but at the time I was more in a hurry to meet my deadline. After quickly looking back over the script and the patch it would seem that line 57 should not be changed but rather a new lined added after the check to see if arg is null in append (line 51). The new line should say:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;arg = arg.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Honestly I&amp;#8217;m still a little confused how arg ends up being a jQuery object but it needs to be a regular dom node before being appended.&lt;/p&gt;</description>
 <pubDate>Sat, 16 Sep 2006 22:21:39 +0000</pubDate>
 <dc:creator>Brandon Aaron</dc:creator>
 <guid isPermaLink="false">comment 299 at https://mg.to</guid>
</item>
<item>
 <title>Question about the patch</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comment-298</link>
 <description>&lt;p&gt;Thanks for the kind words, Brandon.&lt;/p&gt;

&lt;p&gt;Returning a jQuery object sounds like a great idea. I didn&amp;#8217;t do it in my own code because I wanted to be able to use the DOM creation code standalone as well as with jQuery.&lt;/p&gt;

&lt;p&gt;I have a question about the patch. The &lt;code&gt;return $(e);&lt;/code&gt; makes sense, but what does the change to line 57 do? Given that &lt;code&gt;arg&lt;/code&gt; is a DOM element, then &lt;code&gt;$(arg).get(0)&lt;/code&gt; should just return &lt;code&gt;arg&lt;/code&gt;. So I would expect that these two statements would be equivalent:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;e.&lt;span style=&quot;color: #006600;&quot;&gt;appendChild&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;vs.&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;e.&lt;span style=&quot;color: #006600;&quot;&gt;appendChild&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; $&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;arg&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Sat, 16 Sep 2006 17:17:59 +0000</pubDate>
 <dc:creator>Michael Geary</dc:creator>
 <guid isPermaLink="false">comment 298 at https://mg.to</guid>
</item>
<item>
 <title>Easy DOM creation for jQuery and Prototype</title>
 <link>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype</link>
 <description>&lt;p&gt;Here is a &lt;a href=&quot;https://jquery.com/&quot; title=&quot;jQuery&quot;&gt;jQuery&lt;/a&gt; plugin that makes it easy to build up a tree of DOM nodes. It lets you write code like this:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; table =&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp;$.&lt;span style=&quot;color: #006600;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; Class:&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;MyTable&quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; $.&lt;span style=&quot;color: #006600;&quot;&gt;TBODY&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$.&lt;span style=&quot;color: #006600;&quot;&gt;TR&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; Class:&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;MyTableRow&quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $.&lt;span style=&quot;color: #006600;&quot;&gt;TD&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; Class:&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;MyTableCol1&quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;howdy&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $.&lt;span style=&quot;color: #006600;&quot;&gt;TD&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; Class:&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;MyTableCol2&quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Link: &#039;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$.&lt;span style=&quot;color: #006600;&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; Class:&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;MyLink&quot;&lt;/span&gt;, href:&lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;https://www.example.com&quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;example.com&#039;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Basically, each function such as &lt;code&gt;$.TABLE&lt;/code&gt; creates a DOM node and takes the following arguments:&lt;/p&gt;

&lt;p&gt;The first argument is an object that list any attributes to be set on the node. You can specify the className attribute in a few different ways depending on your taste:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; className: text&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; Class: text&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;: text &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Any additional arguments after the first one represent child nodes to be created and appended. These arguments can be DOM elements themselves (e.g. inline &lt;code&gt;$.FOO&lt;/code&gt; calls as above), or they can be numbers or strings which are converted to text nodes, or they can be arrays, in which case each element of the array is handled in this same way.&lt;/p&gt;

&lt;p&gt;This interface is inspired by Bob Ippolito&amp;#8217;s &lt;a href=&quot;https://www.mochikit.com/doc/html/MochiKit/DOM.html&quot; title=&quot;MochiKit DOM&quot;&gt;MochiKit DOM&lt;/a&gt; API, although it doesn&amp;#8217;t implement all of the features of that one (yet).&lt;/p&gt;

&lt;p&gt;The code predefines most of the common tags; you can add additional tags by calling:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;$.&lt;span style=&quot;color: #006600;&quot;&gt;defineTag&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tagName &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;nbsp; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// e.g. $.defineTag( &#039;dd&#039; ); &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or simply add the tag names to the tags list in the code.&lt;/p&gt;

&lt;p&gt;One last definition is &lt;code&gt;$.NBSP&lt;/code&gt; which defines a non-breaking space (same as &lt;code&gt;&amp;amp;nbsp;&lt;/code&gt; in HTML).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$._createNode&lt;/code&gt; is an internal helper function used by the &lt;code&gt;$.FOO&lt;/code&gt; functions. I would have hidden it away as a nested function, but I wanted to avoid any unnecessary closures.&lt;/p&gt;

&lt;p&gt;This code doesn&amp;#8217;t actually depend on any of the features of jQuery except for the presence of the &lt;code&gt;$&lt;/code&gt; function&amp;#8212;and it uses &lt;code&gt;$&lt;/code&gt; only as a way to avoid cluttering the global namespace. I haven&amp;#8217;t tested it with &lt;a href=&quot;https://prototype.conio.net/&quot; title=&quot;Prototype.js&quot;&gt;Prototype.js&lt;/a&gt;, but it should work equally well there. Or the code can be used with no library, by preceding it with:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; $ = &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the source code, or you can &lt;a href=&quot;https://mg.to/files/jquery-dom.js&quot;&gt;download it&lt;/a&gt;:&lt;/p&gt;

&lt;div style=&quot;padding: 5px !important; border: 1px solid rgb(253,187,134) !important; background-color: rgb(255,253,245) !important; font-family: Verdana,sans-serif !important;&quot;&gt;&lt;div style=&quot;background-color: rgb(255,250,238) !important;&quot;&gt;&lt;div class=&quot;geshi-javascript&quot;&gt;&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// DOM element creator for jQuery and Prototype by Michael Geary&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// https://mg.to/topics/programming/javascript/jquery&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Inspired by MochiKit.DOM by Bob Ippolito&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Free beer and free speech. Enjoy!&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;br /&gt;&lt;/div&gt;
$.&lt;span style=&quot;color: #006600;&quot;&gt;defineTag&lt;/span&gt; = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tag &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; $&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;tag.&lt;span style=&quot;color: #006600;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;return&lt;/span&gt; $._createNode&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tag, arguments &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; tags = &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;br&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;button&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;canvas&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;div&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;fieldset&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;form&#039;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;h1&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;h2&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;h3&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;hr&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;img&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;input&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;label&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;legend&#039;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;li&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;ol&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;optgroup&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;option&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;p&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;pre&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;select&#039;&lt;/span&gt;,&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;span&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;strong&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;table&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;tbody&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;td&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;textarea&#039;&lt;/span&gt;,&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;tfoot&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;th&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;thead&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;tr&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;tt&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;ul&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; i = tags.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt; - &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;;&amp;nbsp; i &amp;gt;= &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;;&amp;nbsp; i-- &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $.&lt;span style=&quot;color: #006600;&quot;&gt;defineTag&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tags&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;br /&gt;&lt;/div&gt;
$.&lt;span style=&quot;color: #006600;&quot;&gt;NBSP&lt;/span&gt; = &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\u&lt;/span&gt;00a0&#039;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;br /&gt;&lt;/div&gt;
$._createNode = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tag, args &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; fix = &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;class&#039;&lt;/span&gt;:&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;className&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Class&#039;&lt;/span&gt;:&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;className&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; e;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; attrs = args&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt; || &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e = document.&lt;span style=&quot;color: #006600;&quot;&gt;createElement&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; tag &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; attr &lt;span style=&quot;color: #C00000;&quot;&gt;in&lt;/span&gt; attrs &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; a = fix&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;attr&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt; || attr;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;a&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt; = attrs&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;attr&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; i = &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;;&amp;nbsp; i &amp;lt; args.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;;&amp;nbsp; i++ &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; arg = args&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg == &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #C00000;&quot;&gt;continue&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg.&lt;span style=&quot;color: #006600;&quot;&gt;constructor&lt;/span&gt; != Array &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; append&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #C00000;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; j = &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;;&amp;nbsp; j &amp;lt; arg.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;;&amp;nbsp; j++ &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; append&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#91;&lt;/span&gt;j&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; ex &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Cannot create &amp;lt;&#039;&lt;/span&gt; + tag + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;gt; element:&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&#039;&lt;/span&gt; +&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; args.&lt;span style=&quot;color: #006600;&quot;&gt;toSource&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&#039;&lt;/span&gt; + args &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; append&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg == &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #C00000;&quot;&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; c = arg.&lt;span style=&quot;color: #006600;&quot;&gt;constructor&lt;/span&gt;;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;switch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #C00000;&quot;&gt;typeof&lt;/span&gt; arg &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;number&#039;&lt;/span&gt;: arg = &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt; + arg;&amp;nbsp; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// fall through&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;string&#039;&lt;/span&gt;: arg = document.&lt;span style=&quot;color: #006600;&quot;&gt;createTextNode&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.&lt;span style=&quot;color: #006600;&quot;&gt;appendChild&lt;/span&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#40;&lt;/span&gt; arg &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #C00000;&quot;&gt;return&lt;/span&gt; e;&lt;br /&gt;
&lt;div style=&quot;background-color:rgb(255,234,216);&quot;&gt;&lt;span style=&quot;color: #66cc66;color: #0000FF;&quot;&gt;&amp;#125;&lt;/span&gt;; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
</description>
 <comments>https://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype#comments</comments>
 <category domain="https://mg.to/topics/programming/javascript">JavaScript</category>
 <category domain="https://mg.to/topics/programming/javascript/jquery">jQuery</category>
 <category domain="https://mg.to/topics/programming">Programming</category>
 <enclosure url="https://mg.to/files/jquery-dom.js" length="1600" type="application/x-javascript" />
 <pubDate>Mon, 27 Feb 2006 19:07:54 +0000</pubDate>
 <dc:creator>Michael Geary</dc:creator>
 <guid isPermaLink="false">127 at https://mg.to</guid>
</item>
</channel>
</rss>
