<div id="0000000000000asd">id1</div>
<div id="asd0000000000000">id2</div>
<div id="000000asd0000000">id3</div>
<div id="0000000000000">id4</div>
<div class="d42342342342asd">class1</div>
<div class="asdd42342342342">class2</div>
<div class="d42342asd342342">class3</div>
<div class="d42342342342">class4</div>
<script>
let items = document.querySelectorAll('[class*=asd], [id*=asd]');
for (var i = items.length - 1; i >= 0; i--) {
items[i].remove();
}
// id4, class4
</script>
<script type="text/javascript" charset="utf-8">
$(function(){
$("select#city").change(function(){
$.getJSON("/select.php",{id: $(this).val(), ajax: 'true'}, function(j){
var options = '';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
}
$("select#myselect").html(options);
})
})
})
</script>