Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Interaction between CSS and JS Date: Tue, 09 Jun 2015 01:06:10 +0200 Organization: PointedEars Software (PES) Lines: 24 Message-ID: <7394818.S3GjLBVZgg@PointedEars.de> References: <16297177.zCTbze9WAx@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1433804946 28892 eJwFwQENADAIAzBLENh+5BzI/Et4i6BzThJMCDoDH2+OtBCD8ke2TaHaIv2mXZVH2pb2fSD7EQU= (8 Jun 2015 23:09:06 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 8 Jun 2015 23:09:06 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNx9sRACEIBMGUDpaHhiPg5h/CWfPT4wiJTgsPc77KtqHU9hkj73PpYhfHt5+Ri9FGgpkdemUBn79j9kDnB2kwFfs= Cancel-Lock: sha1:tEg5x/Q4fQ5xSweEQz/6R5zLJiY= X-NNTP-Posting-Host: eJwNyMEBADEEBMCWuLC0g9j+S8jNc/xAMWFwmNMZJXPtDyms2mRo3lyxOq1kfFkg07cbGNYDIeMRxA== Xref: csiph.com comp.lang.javascript:28053 Christoph M. Becker wrote: > Thomas 'PointedEars' Lahn wrote: >> [The “className”] property should only be used if >> >> a) a class name is to be added and duplicate class names are not an >> issue; b) the “classList” property is not available. >> >> The disadvantage of the “className” property is that proper removal or >> replacement of a class name requires regular expressions. “classList” >> allows the caller to use only string values. > > classList is certainly preferable, if it is supported. Unfortunately, > IE 8 seems to be still in widespread use.[1] Wrapper methods like jsx.dom.*className() can take care of that: -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.