I'm currently using this to get the class for a specific bit of HTML on the page:
$(this).parent("div").attr('class')
But that div
has multiple classes: current_status status_billed
My end goal here is to grab the class that starts with status_
and replace it with a different class name.
So using my .parent()
function above, I'm able to select the div I need, but I then need to remove the status_billed
class and replace it with, for example, status_completed
(or a number of other class names).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…