faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

17 of 32 people (53%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

how can i insert text into an IFRAME using a button (onClick-event)?

Apr 7th, 2008 23:49
ha mo, Jeff Papineau, lode van de velde,


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>Iframe Insert Text Demo</title>
</head>
<body>
<script>
function insertText() {
var textstring = "Insert me into the Iframe please";
document.getElementById
("iframetest").contentWindow.document.body.innerHTML = textstring;
}
</script>
<iframe height="150" width="400" src="javascript:void(0)" 
frameborder="1" id="iframetest" name="iframetest"></iframe>
<button onClick="insertText()"> Insert Text in Iframe </button>
</body>
</html>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com