hi everyone: I have a problem with a small function I wrote to practice the getElementbyId method - the function i wrote can be made without this method but i wanted to practice it - why doesn't it run? need u guys quickly progfrog <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255 "> <script type="text/javascript"> function michal(x) { var checky=document.getElementById(x) if (idan.checky.checked) { idan.comment1.style.display="none"; } else { idan.comments1.style.display="block"; } </script> </head> <body> <form id="idan"> <input type="checkbox" id="check1" onclick="michal('check1')" checked /><textarea id="comments1" cols="30" rows="7">I think that</textarea> <br> </form> </body> </html>
hi webexpert i added the s and is still doesn't work- is there anything elese here that is not o.k- did you manafed to run this in your computer? need u again progfrog
alright - i made it functional now... try this code; <script type="text/javascript"> function michal(x) { var checky=document.getElementById(x); if (checky.checked) { idan.comments1.style.display="none"; } else { idan.comments1.style.display="block"; } } </script> i replaced if (idan.checky.checked) with if (checky.checked) and the function ending brace was missing.. enjoy..