https://blog.csdn.net/superit401/article/details/51771174spa
<div class='box'> <span id="contactStar" data-id='f1' name='fl' style="color:red">*</span> <span id="contactPhoneStar" data-id='f1' name='fl' style="color:red">*</span> <span id="phoneStar" data-id='f1' name='fl' style="color:red">*</span> <button onclick="getCheckedValues();">點擊</button> </div>
// * 選擇器:[attribute*=value],匹配給定的屬性是以包含某些值的元素。舉個例子說明一下:.net
function getCheckedValues () { console.log($("span[id*='Star']")) }