troubleshooting Question

highlight words within iframe webpage

Avatar of josefkrzysztof
josefkrzysztof asked on
4 Comments1 Solution836 ViewsLast Modified:

I would like to add anm input text and an input button to find and highlight words (simple or compung) inside the iframe placed webpage.

Very grateful for any help
The code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<script type="text/javascript">
// <![CDATA[
window.onload = function()
	var iframe_window = window.frames["my_iframe"];
	var iframe_body_html = iframe_window.document.getElementsByTagName("body")[0].innerHTML;
	//var html =,"you"); //case-insensitive
	//var html = iframe_body_html.replace(/me/g,"you");
	//html = html.replace(/ME/g,"YOU");
	document.getElementById("output").innerHTML = html;
// ]]>
<iframe name="my_iframe" id="my_iframe" width=500 height=500 src=""></iframe>
<div id="output"></div>
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros