<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<ul>li{
display: none;
}window.onload = function(){
show();
}
function show(){
var list = document.getElementsByTagName('li');
list[rand(0, list.length - 1)].style.display = 'block';
}
function rand(min, max){
return Math.floor(Math.random() * (max - min + 1)) + min;
} document.addEventListener('DOMContentLoaded', function() {
var li = document.querySelectorAll('li');
li[Math.floor(Math.random() * li.length)].style.display = 'list-item';
}, false);$(function() {
var li = $('li');
li.eq(Math.floor(Math.random() * li.length)).show();
});
foreach ( $items as $item ) {
echo <<<HTML
<tr>
<td><span>{$item->number}</span></td>
<td><span>{$item->name}</span></td>
<td><a href="{$item->link}" target="_blank"><span>Открыть</span></a></td>
</tr>
HTML;
} <div class="clickme">
Нажми на меня!
</div>$('.clickme').click(function(){
if (!$(this).data('status')) {
$(this).html('Молодец! А еще раз слабо?');
$(this).data('status', true);
}
else {
$(this).html('Ну ты гигант! А может еще раз?');
$(this).data('status', false);
}
});
{
"fallback_encoding": "Cyrillic (Windows 1251)",
}