<div id="aaaa" style="left:10px;top:10px; width:100px;height:100px"></div>$("#aaaa").atrr("style","")
width height top 都删除,唯独 保留了,style="left:10px"

解决方案 »

  1.   


        $("#aaaa").removeAttr("style");
      

  2.   


    $("#show").removeAttr("style"); //ie,ff均支持$("#show").attr("style","");   //firefox支持,ie不支持 
      

  3.   

    $("#aaaa").removeAttr("style");
    $("#aaaa").style.left="10px"
      

  4.   

    5楼正解,还可以
    将style写为样式
    $("#aaaa").removeClass('样式名');
    $("#aaaa").addClass('样式名');
      

  5.   

    楼上都正解,建议这种需要修改的style最好不要以内嵌形式存在
      

  6.   

     $("#aaaa").removeAttr("style");
    $("#aaaa").css({"left":"10px"}); 
      

  7.   

    将行内样式先写到外面写一个class,先remove
    $("#aaaa").removeClass(''); 
    然后再add
    $("#aaaa").AddClass('');