Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
how to add button inside select in jquery

Here I'm looking for button side the select option any one can please help on it. i want repeat button and option like this. I have no idea on it i am trying to this but not working please help anyone.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Form control: select</h2>
  <p>The form below contains two dropdown menus (select lists):</p>
  <form action="/action_page.php">
    <div class="form-group">
      <label for="sel1">Select list (select one):</label>
      <select class="form-control" id="sel1" name="sellist1">
       <button>button1</button>
       <option>1</option>
        <button>button1</button>
        <option>2</option>
        <button>button1</button>
        <option>3</option>
        <button>button1</button>
        <option>4</option>
        <button>button1</button>
      </select>
      
    <button type="submit" class="btn btn-primary">Submit</button>
  </form>
</div>

</body>
</html>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sorry to say this but No, you can't put any HTML inside of an option element, just text. You'll need to use either an list element to emulate a select, or use a change-handler on the select element.

You can use grid for this type of functionality..

Or you can use Bootstrap dropdown to achieve such functionality. As far as I know it wont be possible to achieve this in native select component.

Please check this link https://www.w3schools.com/bootstrap/bootstrap_dropdowns.asp You can use something like this for this bootstrap dropdown

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!