How to make HTML select options searchable

Answer would be: <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css” rel=”stylesheet” /> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js”></script> <div id=”product_attributes” class=”panel wc-metaboxes-wrapper hidden”> <div class=”toolbar toolbar-top”> <span class=”expand-close”> <a href=”#” class=”expand_all”><?php esc_html_e( ‘Expand’, ‘woocommerce’ ); ?></a> / <a href=”#” class=”close_all”><?php esc_html_e( ‘Close’, ‘woocommerce’ ); ?></a> </span> <select name=”attribute_taxonomy” class=”attribute_taxonomy js-ao-select-options”> <option value=””><?php esc_html_e( ‘Custom product attribute’, ‘woocommerce’ ); ?></option> <?php global $wc_product_attributes; $attribute_taxonomies = … Read more

Selecting multiple options onclick

this isn’t a WordPress thing, just an issue with your JS. this: jQuery(“select[name^=’post_author’]”).attr(‘selectedIndex’,selected); should be: jQuery(“select[name^=’post_author’]”).val(selected).attr(‘selected’,’selected’);