---
title: "jquery子iframe访问父容器的方法"
author: "mxdba321123"
date: "2010-12-12T15:29:28Z"
tags: []
categories: ["Web前端"]
slug: "jquery-iframe"
draft: false
lastmod: "2010-12-12T15:29:28Z"
id: 840035
url: "https://mxdba.iteye.com/blog/840035"
---

在一个iframe中使用jquery选取父容器中的元素

 

网上 很多种写法是：

 

$('#id', window.parent.document)

 

但是我用了下不行，我的jquery版本是1.4.3

 

最后发现可以的方法是

 

```
parent.$("#config_${config.id}").hide("slow");
```

 

使用js内置访问方法parent