Home > Web Front-end > JS Tutorial > body text

jquery method to get iframe src attribute value_jquery

WBOY
Release: 2016-05-16 16:35:13
Original
1713 people have browsed it

Get the value of iframe src attribute:

Html code

<!DOCTYPE HTML> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>jquery</title> 
<style type="text/css"> 
</style> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
<script type="text/javascript"> 
$(document).ready(function (){ 
var dk = $(window.parent.document).find("#iframe_id").attr("src"); 
alert(dk); 

}); 
</script> 
</head> 
<body> 
<iframe id="iframe_id" name="iframe_name" src="http://www.baidu.com"></iframe> 
</body> 
</html>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template