🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #50686

Re: jaki obiekt/metoda do zmiennej zawartosci

#50686
From: Peter May
Date: Tue, 29 Mar 2011 19:07
24 lines
1836 bytes
W dniu 29-03-2011 19:22, zlotowinfo pisze:
> nie do końca zrozumiałem na początku, poprawiłem i coś nie pokazuje
> linków tylko normalnie tekst ktory został wpisany
> <a href=http://wp.pl>zmieniony tekst</a>
>
>
> <script>
> function changeSpanText(id,txt)
> {
> p2=document.getElementById(id);
> if(typeof(p2.innerText) != 'undefined'){p2.innerText = txt;}
> else if(typeof(p2.textContent) != 'undefined') {p2.textContent = txt;}
> else if(typeof(p2.text) != 'undefined') {p2.text = txt;}}
> </script>
>
> <span id="dupa"></span><br />
> <input type="button" value="Change Span innerText"
> onclick="changeSpanText('dupa','<a href=http://wp.pl>zmieniony
> tekst</a>')" />

To może Ty potrzebujesz innerHTML?

-- 
Peter
Technical Details
Message-ID: <imtakr$q1$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail
References: <imobbc$i8o$1@inews.gazeta.pl> <4d90fbcf$0$2455$65785112@news.neostrada.pl> <imruil$84e$1@inews.gazeta.pl> <imrvv9$svi$1@news.onet.pl> <ims4co$pq9$1@inews.gazeta.pl> <ims8bo$5uk$1@news.onet.pl> <imt4g7$bl6$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail
From: Peter May <peter.may@onet.pl>
Newsgroups: pl.comp.lang.javascript
Subject: Re: jaki obiekt/metoda do zmiennej zawartosci
Date: Tue, 29 Mar 2011 21:07:04 +0200
Organization: http://onet.pl
Lines: 24
Message-ID: <imtakr$q1$1@news.onet.pl>
References: <imobbc$i8o$1@inews.gazeta.pl> <4d90fbcf$0$2455$65785112@news.neostrada.pl> <imruil$84e$1@inews.gazeta.pl> <imrvv9$svi$1@news.onet.pl> <ims4co$pq9$1@inews.gazeta.pl> <ims8bo$5uk$1@news.onet.pl> <imt4g7$bl6$1@inews.gazeta.pl>
NNTP-Posting-Host: 178.180.139.32.nat.umts.dynamic.eranet.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1301425629 833 178.180.139.32 (29 Mar 2011 19:07:09 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Tue, 29 Mar 2011 19:07:09 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pl; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
In-Reply-To: <imt4g7$bl6$1@inews.gazeta.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit