Nová ukázka
Reset
Načíst z URL
Uložit a získat odkaz
Vztahuje se k…
Nevyplňujte
Napiště „nejsem robot“
▶
Přepnout zobrazení
Výsledek
<a href="#id1">fds</a> <a href="#id2">fsd</a> <a href="#id3">fsd</a> <div id="id1">1</div> <div id="id2">2</div> <div id="id3">3</div>
HTML
Autoformát
Standardní režim
Mobilní zobrazení
.active {background:red;width:50px;height:50px;}
CSS
Autoformát
CSS reset
Až na konci
setActive = function() { var hash = window.location.hash.substring(1); var el = document.getElementById(hash); if(el) el.className += "active"; } $(document).ready(function() { $('a').click(function() { $('div').removeClass('active'); setActive(); }) });
J
ava
S
cript
Autoformát
jQuery
Umístění JS
window.onload
</head>
</body>