Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q283 Can I access the browsers find and copy controls?

irt.org | Knowledge Base | JavaScript | Misc | Q283 [ previous next ]

Q283 Can I access the browsers find and copy controls?

In Netscape Navigator 4 you can combine the documents find() method with the documents getSelection() method to create a simple page search facility. The Copy button copies any selected/highlighted text into the form. The Find button then attempts to find any ocurrences of the text in the form in the page.

<script language="JavaScript1.2"><!--
if (document.layers) {
    document.write('<form name="myform">');
    document.write('<input type="text" name="mytext">');
    document.write(' <input type="button" name="getstring" value="Copy" onClick="document.myform.mytext.value = document.getSelection()">');
    document.write(' <input type="button" value="Find" onClick="find(document.myform.mytext.value,false)">');
    document.write('<\/form>');
}
//--></script>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.