def compare_srt(str1,str2)
str_start = re.sub('[*]', '', str1) #去除*號返回結果
str_end = re.sub('[*]', '', str2)
return str_start,str_end
<script> // 遍歷select $("#envirType").each(function() { // this代表的是<option></option>,對option再進行遍歷 $(this).children("option").each(function() { // 判斷需要對那個選項進行回顯 if (this.value === "{{ envir_str }}") { console.log($(this).text()); // 進行回顯 $(this).attr("selected","selected"); } }); }) </script>