<script>
var comp101_note = document.getElementById("comp101_note");
var comp101_pdf = document.getElementById("comp101_pdf");
comp101_note.onclick = function(){
comp101_pdf.slideToggle();
};
</script>
<html>
<table>
<tr><td>Ders</td></tr>
<tr><td id="comp101_note">COMP101</td></tr>
</table>
<object width="400" height="400" data="1.pdf" id="comp101_pdf"></object>
</html>
i want to do it like var etc. because of i will use these code in windows application
slideToggle()is not a javascript function, it is from jQuery api.jquery.com/slidetoggle You should look at the browser console to see the errors