So I am really new to javascript, I wouldn't know a line of it if my life depended on it. Somehow I managed to get this to work....
<a href="javascript:void(0)" onmousedown="toggleDiv(' , $message['id'] , ');">
Problem is I need 2 divs to toggle. I thought since they both had the same ID it would toggle them both but it does not. I changed the second one to have "dateline" after the message ID. Not sure how to make this work and would really appreciate a hand :).
I do not wish to use jQuery.
Was asked for this:
echo '<script type="text/javascript">
function toggleDiv(divid){
if(document.getElementById(divid).style.display == \'none\'){
document.getElementById(divid).style.display = \'block\';
document.pageLoading.TCallLabel(\'/\',\'restart_function\');
}
else{
document.getElementById(divid).style.display = \'none\';
}
}
</script>';