Jump to content

How to to call an RETURN javascrtip function from php?


adredz

Recommended Posts

I have 4 divisions, the three being the the buttons and the fourth is the display which only shows up when one of the buttons is clicked. My idea is to assign the id of the fourth div when the var tabNum is equal to 3. Could you pls check the php part of my code because it creates error. Here's my code below:

 

<html>

<body>

 

<script type="text/javascript">

 

var tabNum=0;

function setTab(tab)

{

tabNum = tab;

}

 

function getTab(tab){

return tabNum;

}

</script>

 

 

<div id="portfolio">

<div id="web" onclick="setTab(1)">1st tab</div>

<div id="logo" onclick="setTab(2)">2nd tab</div>

<div id="flyer" onclick="setTab(3)">3rd tab</div>

 

<div id="<?php if ((echo "<script language='javascript'> getTab(); </script>"; ) == 3)     

        { echo "web_entries;" } ?>"></div>

</div>

 

</body>

</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.