I would like to remove all parameters (but the first with value = 0) from select with id = "myid".
I would not use empty () and then append ().
If this is the first item, use gt and remove
$("#myid option:gt(0)").remove();
use attribute selector
$('#myid option[value!="0"]').remove();
use filter
$('#myid option').filter( function () { return parseInt(this.value,10) !== 0; } );
Source: https://habr.com/ru/post/1445145/More articles:Css Focus on the appearance of the input div - cssError calling GetFilterVersion on Apache in Tomcat Redirector ISAPI Filter - 32-bit W2K8 SP2 - tomcatDoctrine - Get entity and relationships in one query - symfonySTI rails redefine areas - ruby-on-railsWhat would be a good code structure for test fields? - javaInstall the correct version of Firebird (32 bit or 64 bit) using Inno Setup - installerJQuery Mobile Autocomplete POST Add Parameter - jqueryWindow scaling based on mouse position - c ++How to create a copy of a currency in a country that is not related to ISO 3166, for example en_UK? - javaIntermittent slow frames on Android OpenGL ES 2.0 - javaAll Articles