Thread: Call function

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    29
    Rep Power
    0

    Call function


    Hi to all, i have been trying to call 4 html/htm files with buttons vor each, but for now i have this and can`t continue. Dont know how. Sorry, i read a lot of articles but its not clear to me how to continue.
    If you dont want to write the correct code , give me a direction how to continue.

    Please help:

    Code:
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    		<script type="text/javascript">
    			function selectTask (taskDir) {
    				document.getElementById("?????????").innerHTML="????????"
    			}	
    		</script>
    	</head>
    <body>
    <button onclick="selectTask()">task1</button>
    <button onclick="selectTask()">task2</button>
    <button onclick="selectTask()">task3</button>
    <button onclick="selectTask()">task4</button>
    <iframe src = "task 4.htm" id="TASK4"></iframe>
    <iframe src = "task 3.htm" id="TASK3"></iframe>
    <iframe src = "task.htm" id="TASK2"></iframe>
    <iframe src = "task 1 .htm" id="TASK1"></iframe>
    </body>
    </html>
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,176
    Rep Power
    184
    You need to access the iFrame(s) with "contentWindow": https://developer.mozilla.org/en-US/...rame#Scripting.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    29
    Rep Power
    0
    This post is [SOLVED]

IMN logo majestic logo threadwatch logo seochat tools logo