🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: newbie: problem z keyup() z jQuery

#51626
From: jivanmukta
Date: Wed, 02 Dec 2015 14:41
9 lines
2816 bytes
Mam jeszcze problemik z jQuery. Potrzebuję na stronce włączać/wyłączać wiersze formularza, w zależności od wyboru na liście <select>. Nie działa mi funkcja setBRTags() która włącza/wyłącza tagi <br clear="both"> (żeby nie tworzyła się pusta przestrzeń na formularzu). Oto ta funkcja:

function setBRTags() {
    setCurrentStyle($('div[class="tip" style|="display: block"] + br[clear="both"]')[0], 'display', "");
    setCurrentStyle($('div[class="tip" style|="display: none"] + br[clear="both"]')[0], 'display', "none");
}

Problem w tym, że oba wywołania $(...)[0] zwracają undefined, nie wiem co jest źle (jestem kiepski w jQuery). Wiersz formularza zawiera zawsze <div class="tip">...</div><br clear="both">. Chcę wyłączyć wszystkie br dla odpowiednich wierszy.
Wszystko jest na http://jsfiddle.net/rto26uvz/3/ ale nie umiem włączyć jQuery na jsfiddle. Jak by ktoś mi mógł pomóc...
Technical Details
Message-ID: <d46dc5f2-56c9-4956-8922-d1add9a1a50a@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!mv3no10059737igc.0!news-out.google.com!z49ni39188qgd.1!nntp.google.com!b51no5657344qgf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <d8bb1c55-aa00-4bbb-bb65-862e4f875852@googlegroups.com> <83661$5652e8f8$6def49cc$2822@nntpswitch.blueworldhosting.com> <896e78d8-8f87-4b30-a111-3bc8b4281839@googlegroups.com> <dcb43$565348af$6def49cc$3178@nntpswitch.blueworldhosting.com> <557dc167-faeb-4079-9b4b-a0596a5776d2@googlegroups.com> <9f68c463-1274-4cef-8767-0209cee70d05@googlegroups.com> <76894416-3fa0-44a3-9964-cbe04f759e0a@googlegroups.com> <9d400653-3feb-4292-b02e-889ae4de43d0@googlegroups.com> <03bfb47b-1223-458b-8ccc-b2a7de94a643@googlegroups.com> <w7p7wcxnca3n.15f9jpairlt9l.dlg@40tude.net> <e8d122de-f26f-49ec-8126-ebea7fd5fd02@googlegroups.com> <yrusih068t0b.y6yjvtvl8wj0.dlg@40tude.net> <n3cj0k$81a$1@speranza.aioe.org> <1w4bibnuwtj22$.1c32m3jeca1jc$.dlg@40tude.net>

Show Full Headers
Complete Article Headers
X-Received: by 10.182.28.70 with SMTP id z6mr2777897obg.41.1449067303521;        Wed, 02 Dec 2015 06:41:43 -0800 (PST)
X-Received: by 10.140.99.69 with SMTP id p63mr53566qge.1.1449067303487; Wed, 02 Dec 2015 06:41:43 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!mv3no10059737igc.0!news-out.google.com!z49ni39188qgd.1!nntp.google.com!b51no5657344qgf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.javascript
Date: Wed, 2 Dec 2015 06:41:43 -0800 (PST)
In-Reply-To: <1w4bibnuwtj22$.1c32m3jeca1jc$.dlg@40tude.net>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.72.94.100; posting-account=Y8V58QoAAACtLuF8lEt8MaiUjYUTCWP6
NNTP-Posting-Host: 89.72.94.100
References: <d8bb1c55-aa00-4bbb-bb65-862e4f875852@googlegroups.com> <83661$5652e8f8$6def49cc$2822@nntpswitch.blueworldhosting.com> <896e78d8-8f87-4b30-a111-3bc8b4281839@googlegroups.com> <dcb43$565348af$6def49cc$3178@nntpswitch.blueworldhosting.com> <557dc167-faeb-4079-9b4b-a0596a5776d2@googlegroups.com> <9f68c463-1274-4cef-8767-0209cee70d05@googlegroups.com> <76894416-3fa0-44a3-9964-cbe04f759e0a@googlegroups.com> <9d400653-3feb-4292-b02e-889ae4de43d0@googlegroups.com> <03bfb47b-1223-458b-8ccc-b2a7de94a643@googlegroups.com> <w7p7wcxnca3n.15f9jpairlt9l.dlg@40tude.net> <e8d122de-f26f-49ec-8126-ebea7fd5fd02@googlegroups.com> <yrusih068t0b.y6yjvtvl8wj0.dlg@40tude.net> <n3cj0k$81a$1@speranza.aioe.org> <1w4bibnuwtj22$.1c32m3jeca1jc$.dlg@40tude.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d46dc5f2-56c9-4956-8922-d1add9a1a50a@googlegroups.com>
Subject: Re: newbie: problem z keyup() z jQuery
From: jivanmukta@poczta.onet.pl
Injection-Date: Wed, 02 Dec 2015 14:41:43 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit