How do I change an elements class in jquery?

前端 未结 4 1269
情话喂你
情话喂你 2021-01-15 05:36

Assuming I have

    how can I change the value of verticalList using jquery?

4条回答
  •  逝去的感伤
    2021-01-15 06:22

    I thnik what you want to do is remove that class and change to another? see addClass and removeClass

    $('.verticalList').addClass('foo').removeClass('verticalList') 
    

    P.S. I've corrected spelling of 'vertical' in this version

提交回复
热议问题