Here is the code
for (var i = 0; i < jsonArr.length; i++) {
var obj = jsonArr[i];
htmlText += '<option value="'+obj.place+'">' + placeName + '</option>';
}
I want to show Images as well as place name on the option tag dynamically?
Here is the code
for (var i = 0; i < jsonArr.length; i++) {
var obj = jsonArr[i];
htmlText += '<option value="'+obj.place+'">' + placeName + '</option>';
}
I want to show Images as well as place name on the option tag dynamically?
from your question, you mentioned as
for(var i=0;i<jsonArr.length;i++){
var obj = jsonArr[i];
htmlText += '<option value="'+obj.place+'">'+placeName+'</option>';
}
this is not possible, you need to use plugins
try this:
<option value="vaulue_in_integer" id="ID" style="background: url(imageName.png) right no-repeat; width: ABCpx; height: ABCpx">DEMO_TEXT</option>