Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Help me with this JavaScript and iframe tag

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #238107
    delta
    Participant

    I have an input box within my html page and an iframe tag in there also. The search box is meant to grab an element from tree.html in the frame, but it doesn’t. How do I get the JS to search within the iframe of another page?

    <script>
    function search(){
    var val = document.getElementById(‘search’).value;
    val = trim(val);
    document.getElementById(val).focus();
    }
    </script>

    <body>

    <input id=”search” onkeydown=”search();”>

    <iframe src=”tree.html”> </iframe>

    </body>

    #238110
    Shikkediel
    Participant

    Much easier with jQuery but here’s a pure JS approach :

    http://stackoverflow.com/a/11107977/3168107

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.