JavaScript

From Ilianko
Revision as of 11:58, 17 June 2011 by Anko (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Показване и скриване на елемент.

<script>
  function hide(id)
  {
    var e = document.getElementById(id);
    if(e.style.display == 'inline')
      e.style.display = 'none';
    else
      e.style.display = 'inline';
  }
</script>

<p onclick="hide('b')">SEO - оптимизация за търсачки</p>
<div id="b" style="display:none;position:relative; left:15px; top:10px">
  <img onclick="hide('b')"src="logo.png" />
</div>