There are a couple of things you need to make happen in order to get the results you're looking for:
#1: Show a select menu when the image is clicked on
You can have a select menu appear by adding an event listener to your img tag, so that when the image is clicked on, the select menu will be shown.
myImg.addEventListener('click', function() {
myMenu.style.display = "inline-block";
});
#2: Have the chosen option appear in the input box
In order to show the selected option in your input box, you'll need another event listener:
myMenu.addEventListener('change', function(e) {
myInput.value = e.target.value;
});
Putting those two event listeners together with a little bit of CSS, the HTML for your <select> menu, and a few variable declarations gives us this working code:
$(document).ready(function() {
var myInput = document.getElementsByTagName('input')[0];
var myImg = document.getElementsByTagName('img')[0];
var myMenu = document.getElementById('selectMenu');
myImg.addEventListener('click', function() {
// when the img is clicked, show the select menu
myMenu.style.display = "inline-block";
});
myMenu.addEventListener('change', function(e) {
// when an option in the select menu is selected, show it in the input box
myInput.value = e.target.value;
});
});
#selectMenu {
display: none;
float: right;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet">
<div class="input-group">
<input class="form-control" type="text">
<span class="input-group-addon">
<img src="./img/plus.png"alt="minus" class="align-middle">
</span>
<br />
</div>
<select id="selectMenu">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
</select>
Of course, using Bootstrap or just plain CSS, you can style the menu however you want.
selectmenu? Can you clarify what you're asking? What do you want to happen after you click on theimg?