-
-
Save eksana/d1cf61a53abccb3e962937e8f33b359d to your computer and use it in GitHub Desktop.
Добавляем разные новые классы
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li class="liclass"></li> | |
<li class="liclass"></li> | |
<li class="liclass"></li> | |
<li class="liclass"></li> | |
<li class="liclass"></li> | |
</ul> | |
$(function(){ | |
$('li').each(function(i){ | |
var $tc = $(this).attr('class') | |
$(this).attr('class', $tc+i).text($(this).attr('class')) | |
}) | |
}) | |
https://toster.ru/q/192705 | |
http://jsfiddle.net/dez15gL8/1/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://toster.ru/q/192705
http://jsfiddle.net/dez15gL8/1/