jquery- get different page elements

前端 未结 4 765
别那么骄傲
别那么骄傲 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 15:04

    By default, selectors perform their searches within the DOM starting at the document root.
    If you want to pass alternate context, you can pass to the optional second parameter to the $() function. For eg,

    $('#name', window.parent.frames[0].document).attr();

提交回复
热议问题