set the value outisde the parent..

set the value outisde the parent..

I have list of department id with view link (dislpaying in table1 and hiding table 2).
If view link clicked, using toggle.. i can able to hide table1 and display the new table say table 2.

i need to set the value of selected departmentid in table 2 ? how to do it in simple way...?