Hi Guys,
Im USELESS! with javascript. Can someone help here?
Ive got the below,
This works fine:
var objDiv = document.getElementById("publictext");
objDiv.scrollTop = objDiv.scrollHeight;
var objDiv = document.getElementById("privatetext");
objDiv.scrollTop = objDiv.scrollHeight;
I want to check if a checkbox id=chk is checked.
If it is, Do the above 4 lines.
If it isnt.
Do nothing.
How can i get this to work?
Thanks
G
Code:
function scroller(){
var scrolling = document.getElementById('chk');
if(scrolling.checked != "checked")
else
var objDiv = document.getElementById("publictext");
objDiv.scrollTop = objDiv.scrollHeight;
var objDiv = document.getElementById("privatetext");
objDiv.scrollTop = objDiv.scrollHeight;
}
|