jquery- get different page elements

前端 未结 4 740
别那么骄傲
别那么骄傲 2020-11-30 14:13

I want to get element attribute value which belongs to other html page.

For example if I am in file a.html and want to get data like element attribu

4条回答
  •  北海茫月
    2020-11-30 14:55

    first you will have to fetch the b.html and then you can find the attribute value e.g.

    //if you dont want to display the data make the div hidden
          ^
    $("#someDivID").load("b.html",function(data){
    
    var value=$(data).find("#elementID").attr("attributeName");
    });
    

提交回复
热议问题