I'm a bit stumped by the Facebook implementation of Javascript. I want to set up a listener on a checkbox so that when checked, it changes the class of an element I can get by ID.
I've been using the test console and have tried various permutations. Javascript is NOT my first language, nor my second, third... COuld anyone help me by translating my pseudocode?
<input class="one" type="checkbox" onclick="setcolor(this.checkedornot)">
function setcolor(checkedornot){
if checkedornot == true {set p.one to p.one.GREEN}
if checkedornot == false {set p.one to p.one.RED}
}
Obviously this is not javascript, but that is how I can best explain the functionality I need. In my short tests, FBJS doesn't even seem to register onClick events. Thanks!