I have the below but want to only loop through lines in #lines which have an id starting with total
$(\"#lines li\").each(function() { }
any id
$("#lines li[id^=total]").each(function() { ... });