"search box"
Bootstrap 4.0.0 Snippet by mhk67_

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container top-nav"> <div class="row"> <div class="search-box input-group m-3"> <div class="input-group-prepend"> <button class="btn dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">تمام محصولات</button> <div class="dropdown-menu"> <a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Another action</a> <a class="dropdown-item" href="#">Something else here</a> </div> </div> <input type="text" class="form-control" aria-label="Text input with dropdown button"> <div class="input-group-append"> <button class="btn btn-outline-secondary" type="button">جستجو</button> </div> </div> </div> </div>
.top-nav{ background: #ffffff; direction: rtl; text-align: right; } .top-nav .search-box{ } .top-nav .search-box input:focus,.top-nav .search-box button:focus{ box-shadow: 0 0 0 0rem rgba(0,0,0,0); } .top-nav .search-box .input-group-prepend::after{ content: '|'; color: #ccc; padding-top: 6px; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc; } .top-nav .search-box .input-group-prepend button{ border: 0px; background: #fff; border:1px solid #cccccc; border-left:0px ; -webkit-border-radius:0; -moz-border-radius:0; border-radius:0; } .top-nav .search-box input[type=text]{ border: 0px; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc; } .top-nav .search-box .input-group-append button{ border: 0px; color: #ffffff; background: #262626; border-left:1px solid #cccccc; border-radius: 0; }
$(function(){ $(".search-box .dropdown-menu a").click(function(){ var selText = $(this).html(); $(this).parents().find('button.dropdown-toggle').html(selText); }); });

Related: See More


Questions / Comments: