js取得domはnullテスト

5076 ワード



    
    
    
    
        

これはH 1です

"div1">
"</span><span style="color:#800000;">text/html</span><span style="color:#800000;">"</span> id=<span style="color:#800000;">"</span><span style="color:#800000;">toolbar</span><span style="color:#800000;">"</span>> <input type=<span style="color:#800000;">"</span><span style="color:#800000;">text</span><span style="color:#800000;">"</span> <span style="color:#0000ff;">class</span>=<span style="color:#800000;">"</span><span style="color:#800000;">larry-input</span><span style="color:#800000;">"</span> style=<span style="color:#800000;">"</span><span style="color:#800000;">height:100%;</span><span style="color:#800000;">"</span> name=<span style="color:#800000;">"</span><span style="color:#800000;">username</span><span style="color:#800000;">"</span> id=<span style="color:#800000;">"</span><span style="color:#800000;">username</span><span style="color:#800000;">"</span> placeholder=<span style="color:#800000;">"</span><span style="color:#800000;"> </span><span style="color:#800000;">"</span>> <button <span style="color:#0000ff;">class</span>=<span style="color:#800000;">"</span><span style="color:#800000;">layui-btn layui-btn-sm</span><span style="color:#800000;">"</span> lay-<span style="color:#0000ff;">event</span>=<span style="color:#800000;">"</span><span style="color:#800000;">add</span><span style="color:#800000;">"</span> data-url=<span style="color:#800000;">"</span><span style="color:#800000;">/Backstage/Person/Add</span><span style="color:#800000;">"</span>> </button> <button <span style="color:#0000ff;">class</span>=<span style="color:#800000;">"</span><span style="color:#800000;">layui-btn layui-btn-sm layui-btn-danger isDelete</span><span style="color:#800000;">"</span> id=<span style="color:#800000;">"</span><span style="color:#800000;">pici</span><span style="color:#800000;">"</span> data-url=<span style="color:#800000;">"</span><span style="color:#800000;">/Backstage/Person/BatchDel</span><span style="color:#800000;">"</span>> </button> "</span><span style="color:#800000;">text/javascript</span><span style="color:#800000;">"</span>> <span style="color:#0000ff;">var</span> t = document.getElementById(<span style="color:#800000;">"</span><span style="color:#800000;">toolbar</span><span style="color:#800000;">"</span><span style="color:#000000;">); </span><span style="color:#0000ff;">var</span> t_html =<span style="color:#000000;"> t.innerHTML; </span><span style="color:#0000ff;">var</span> t_text =<span style="color:#000000;">t.innerText; </span><span style="color:#0000ff;">var</span> username = document.getElementById(<span style="color:#800000;">"</span><span style="color:#800000;">username</span><span style="color:#800000;">"</span>);<span style="color:#008000;">//</span><span style="color:#008000;"> null</span> <span style="color:#0000ff;">var</span> div = document.getElementById(<span style="color:#800000;">"</span><span style="color:#800000;">div1</span><span style="color:#800000;">"</span><span style="color:#000000;">); div.innerHTML </span>=<span style="color:#000000;"> t_html; div.innerHTML </span>=<span style="color:#000000;"> t_text; username </span>= document.getElementById(<span style="color:#800000;">"</span><span style="color:#800000;">username</span><span style="color:#800000;">"</span>);<span style="color:#008000;">//</span><span style="color:#008000;"> null</span> <span style="color:#0000ff;">var</span> t1 = <span style="color:#800080;">0</span><span style="color:#000000;">; </span>

 
転載先:https://www.cnblogs.com/enych/p/11504214.html