Reputation: 7942
I have a select list:
<select name="taxonomy[1][]" multiple="multiple" class="form-select" id="edit-taxonomy-1" size="7">
<option value="0">None</option>
<option value="13">Glaciers</option>
<option value="14">Lake Ice</option>
<option value="17">Permafrost</option>
<option value="16">River Ice</option>
<option value="15">Sea Ice</option>
<option value="12">Snow</option>
</select>
How do I use jquery to remove the multiple="mutiple" from the select so that it is just
<select name="taxonomy[1][]" class="form-select" id="edit-taxonomy-1" size="7">
Upvotes: 0
Views: 304
Reputation: 11228
use .removeAttr()
like in your case it should be $("#edit-taxonomy-1").removeAttr("multiple");
Upvotes: 0
Reputation: 47726
On jQuery site: removeAttr
$("#edit-taxonomy-1").removeAttr("multiple");
Description: Remove an attribute from each element in the set of matched elements.
Upvotes: 1