Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Maik Koenig Newsgroups: comp.lang.javascript Subject: Re: Altering a CSS class with JavaScript? Date: Sat, 2 Jun 2018 22:48:25 +0200 Lines: 20 Message-ID: References: <1df34733-dc9a-4edf-a4b8-92dc1de90a16@googlegroups.com> <233c3ea9-b903-44ad-8435-2a6236003a38@googlegroups.com> <3197134.joGGxDtPI3@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net N5BRF37vAXTT8E1FqMFDfArTNa0KT0G/QIE7NnVP1QE6MAmDhO Cancel-Lock: sha1:TSVSK9pOxy2u+wkKmpcOl8FJai0= User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Hamster/2.1.0.1538 In-Reply-To: <3197134.joGGxDtPI3@PointedEars.de> Xref: csiph.com comp.lang.javascript:35171 Am 01.06.2018 um 13:25 schrieb Thomas 'PointedEars' Lahn: > The most simple, compatible, and arguably most efficient, way to modify a > stylesheet is to append a new “link” or “style” element to the “head” > element. (However, I am not certain if it works with “link” elements, too.) var link = document.createElement("link"); link.href = "test.css" link.type = "text/css"; link.rel = "stylesheet"; link.media = "screen, print" document.body.appendChild(link); Greetz, MK -- Kopp-Verlag-Gläubige, Religionsdeppen, rechte Vollidioten und ähnlicher Bio-Abfall werden ohne Hinweis ignoriert! - Sei eine Möwe: Scheiss drauf -