Answer the question
In order to leave comments, you need to log in
How to give an element an existing css style?
Hello! I have a list of dynamically created divs
<div class="someclass">
<div class = "item">1</div>
<div class = "item">2</div>
<div class = "item">3</div>
</div>
<div class = "item active">1</div>
Answer the question
In order to leave comments, you need to log in
Well, these are two lines on jQuery, do not complicate, especially if it is already connected to the project)
$a=1;
while($a<10){
if($a==1){
echo '<div class = "item active">'.$a.'</div>';
} else {
echo '<div class = "item">'.$a.'</div>';
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question