HTML 5小記十五

5610 ワード

1.jsを使用してcssのコントロール属性を取得および変更する操作:
index.html:
                 
css : #scrape{ color:white; } js: function clickScrape(){ var Money = document.getElementsByTagName("wode"); console.log(" "+Money); Money.style.color="red"; div ul ;li , ; }
  • は、パーソナルセンターに達するcssインタフェース
  • を模倣する.
    index.html:
    
            
            

    13117407363

    Lv

    • $100.00

    • $200.00

    • $300.00

    base.css : /* */ #header{ height: 68px; width: 100%; background: purple; } #header .title{ color: white; text-align: center; padding-top: 20px; font: 14; } #header button{ float: right; background-image: inherit; margin-top: -40px; } /* */ #personerMsg{ height: 260px auto; width: 100%; background: purple; text-align: center; } .imgBtn{ width: 70px; height: 70px; border-radius: 35px; /*margin-left: 50%;*/ } .phone{ text-align: center; margin-top: 0px; } .grade{ text-align: center; margin-top: -15px; } #personerMsg ul li{ height: 60px; width: 32%; display: inline-block; } .money p{ margin-top:-10px ; } /* */ #list_item{ margin-top: -20px; height: 300px; width: 100%; background: white; text-align: center; display: inline-block; } #list_item ul li{ height:70px; width: 31%; display: inline-block; border: 1px solid; margin-top: -1px; margin-left: -6px; } #list_item div{ line-height: 35px; } div .right{ } /* tabber*/ #footer{ height: 40px; width: 100%; background: palevioletred; } #footer ul li { text-align: center; width: 32%; height: 20px; color: white; line-height: 15px; display: inline-block; } js:
  • document.getElementsByTagName()は、コントロールindexを取得します.html{divを取得}
  • js { document.getElementsByTagName("div");//document.getElementById("header");//document.getElementByClassName("class1");
    }類似属性document.getElementById(), getElementsByClassName()
    4.
    

    function ajaxTest(){ $.ajax({ type:"get", url:"https://www.baidu.com/「,success:function(){console.log("リクエスト成功");},complete:function(){console.log(「リクエストが完了しました」)},beforeSend:function(){console.log("要求前")},error:function(){console.log(「問題が発生しました」)},async:true }); }


    1.
    2.
    3.

    beforeSend:function (){
    //
    },
    success: complete: