<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.webitoo.com/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>WebIToo - textarea</title>
  <link>http://www.webitoo.com/</link>
  <description>A blog about web 2.0 development, AJAX, MVC, good practice and handy tools to make your life easier in everyday's web developper life.</description>
  <language>en</language>
  <pubDate>Fri, 25 Jul 2008 23:41:07 +0200</pubDate>
  <copyright>All rights reserved</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>How to set the wrap attribute of a textarea without breaking valid XHTML code</title>
    <link>http://www.webitoo.com/post/2007/11/04/How-to-set-the-wrap-attribute-of-a-textarea-without-breaking-valid-XHTML-code</link>
    <guid isPermaLink="false">urn:md5:bb8351ab3218e0f83ac40818c7d8a3e2</guid>
    <pubDate>Sun, 04 Nov 2007 14:59:00 +0100</pubDate>
    <dc:creator>Romain</dc:creator>
        <category>Tricks</category>
        <category>firefox</category><category>javascript</category><category>textarea</category><category>trick</category><category>wrap</category><category>xhtml</category>    
    <description>    &lt;p&gt;WRAP attribute of textarea is not standard. That does not means it's useless, and you'd often want to set it, but then W3C validator will fail.&lt;/p&gt;


&lt;p&gt;Here's a little trick to set it via Javascript, and to make it work under firefow which would not activate it if you just set it with textarea.wrap = ...:&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;&lt;code class=&quot;javascript&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;
&amp;nbsp; document.&lt;span style=&quot;color: #006600;&quot;&gt;ready&lt;/span&gt; = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; obj = document.&lt;span style=&quot;color: #006600;&quot;&gt;all&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;code&lt;/span&gt;, pn = obj.&lt;span style=&quot;color: #006600;&quot;&gt;parentNode&lt;/span&gt;, ns = obj.&lt;span style=&quot;color: #006600;&quot;&gt;nextSibling&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; obj.&lt;span style=&quot;color: #006600;&quot;&gt;wrap&lt;/span&gt; = &lt;span style=&quot;color: #3366CC;&quot;&gt;'off'&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; pn.&lt;span style=&quot;color: #006600;&quot;&gt;removeChild&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;obj&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; pn.&lt;span style=&quot;color: #006600;&quot;&gt;obj&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;obj, ns&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;


&lt;p&gt;It will set the attribute, and rebuild the textarea to make the reticent browser take in account all parameters.&lt;/p&gt;</description>
    
    
    
      </item>
    
</channel>
</rss>