the browser does not have this feature. as you are using jquery, you will need to write a plugin or pick one with the desired features, try:
how to apply search for my html select

Hello
I'm using this code i want search for this select html control how to do so
<script type="text/javascript">
$(document).ready(function() {
$('#list').DataTable( {
initComplete: function () {
this.api().columns("3").every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $("#role_menu_placeholder").empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
i need like this design
help me on my code
thanking you
Developer technologies ASP.NET Other
2 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
2022-10-14T16:18:47.723+00:00 -
QiYou-MSFT 4,326 Reputation points Microsoft External Staff
2022-10-17T07:05:14.02+00:00 Hi @RAVI ,
I think you need to provide more code to implement functionality on top of your code.
You can refer to the following methods:<label for="choice">Search: <input list="choice" name="choice" type="text"> </label> <datalist id="choice"> <option value="Choose">Choose</option> <option value="option">option</option> <option value="Hosp1">Hosp1</option> <option value="Hosp2">Hosp2</option> <option value="Hosp2">Hosp3</option> </datalist>
Best regards,
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.