<script type="text/javascript"> function showHide(element_id) { if (document.getElementById(element_id)) { var obj = document.getElementById(element_id); if (obj.style.display != "block") { obj.style.display = "block"; } else obj.style.display = "none"; } } </script> <a href="javascript:void(0)" onclick="showHide('block_id')">Скрыть/Показать элемент</a><br/><br/> <div id="block_id" style="display: none;"> Тут любой текст и html код<br/> <br/> Дизайн студия OX2 разрабатывает сайты и интернет магазины любой сложности. <br/> По низким ценам! </div> 

implemented a normal function, how to make a constructor out of it? thanks in advance.

  • four
    and most importantly, "Design Studio OX2 develops websites and online stores of any complexity." - Lieutenant Jim Dangle
  • yes it's just an example from the internet - lesha310392
  • it is already possible just to write showHide ('your id') in main.js (or where you have it); without he click on the elements - Lieutenant Jim Dangle
  • the constructor of what ?, can formulate the problem more specifically? - Vyacheslav Danshin
  • designer of turnkey websites implementation at low prices: DDD - Lieutenant Jim Dangle

0