Hi. Sorry but i'm not english so i can make some grammar mistakes. I've written this code:
My question is:HTML Code:<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <title>Lirians</title> <script type="text/javascript" charset="UTF-8" src="skrypty.js"></script> <script type="text/javascript" charset="UTF-8" src="jquery-1.3.2.js"></script> <script type="text/javascript" src="http://koval.ovh.org/skrypty/getebc.js"> </script> </head> <body> <div id="spany"> <span class="ukryj">Ukryj Tekst</span><br /> <span>Lorum Ipsum </span> <span class="ukryj">Ukryj Tekst</span><br /> <span>Lorum Ipsum </span> </div> <script type="text/javascript" charset="UTF-8"> document.getElementsByClassName('ukryj').onclick = ukrywaj; function ukrywaj() { var zmienna = this.nextSibling.nextSibling.style.display; if (zmienna == 'inline') {zmienna = 'none';} else {zmienna = 'inline';} } </script> </body> </html>
- Code is wrong because of "display of undefined". I have span, br and span so first span is like a button and it has to show or hide a next span. I'm beginner but it seems to be a simple mistake. Please help.


Reply With Quote
Thx

Bookmarks