jQuery中,实现属性值的改变

(1)prop属性实现,html中标签的class属性值发生改变:

  语法:$(元素标识).prop("class",类属性值);

  例子:$("#num_"+currentId).prop("class","no-selected");

类似的改变class属性:

  $("#index_" + index).removeClass("current");

  $("#index_" + index).addClass("selected");

 

(2)css实现改变display的值

  $(".testAnalysis").css("display","block");

  $(".testAnalysis").css("display","none");

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2021-12-30
  • 2021-12-03
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案