jonmodem, вам дали код для примера
CODE ( htmlphp):
скопировать код в буфер обмена
<html> <head> <script type="text/javascript"> function action_cx() { if(document.getElementById("checkbox").checked == true) { document.getElementById("checkboxOn").style.display = "inline"; document.getElementById("checkboxOff").style.display = "none"; } else { document.getElementById("checkboxOn").style.display = "none"; document.getElementById("checkboxOff").style.display = "inline"; } } </script> <title>checkbox</title> </head> <body> <form> <input type="checkbox" id="checkbox" onClick="action_cx()" /> <div id="checkboxOn" style="display:none;">Вы нажали на checkbox</div> <div id="checkboxOff">Нажмите на checkbox</div> </form> </body> </html>
что бы сделать функцию универсальной, посмотрите пожалуйста http://www.weblibrary.biz/javascript/document/hierarchy(Отредактировано автором: 30 Июня, 2011 - 13:19:05)
|