Learning Bootstrap 4 and the following are the simple codes. The dropdown is not dropping down or working. When I tried with the select it's working. What are the ways to do things right?
echo '<div class="dropdown">';
echo '<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">'.strtoupper($field).'</button>';
echo '<div class="dropdown-menu">';
for($i = date('Y'); $i >= 1900; $i--) {
echo "<a class='dropdown-item' href='#'>$i</a>";
}
echo '</div></div>';
Try this:
echo "<ul>";
for($i = date('Y'); $i >= 1900; $i--) {
echo "<li><a class='dropdown-item' href='#'>$i</a></li>";
}
echo "</ul>";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.