onValue doesn't fire

230 Views Asked by At
$('#ddEvents').asEventStream('change').onValue(function (f) { alert('hello world'); });

ddEvents is a drop down list. When I change it, the onValue function doesn't fire. What am I getting wrong?

2

There are 2 best solutions below

1
AudioBubble On BEST ANSWER

Hi you code work i did a test on codepen

#add 2 cdn jquery bacon

https://codepen.io/anon/pen/gGrNQV

0
Mike A On

Assuming you are trying to detect a change in what has been selected, this works. Be sure you have included the jquery library correctly:

<select id="ddevents">
     <option value="first">First</option>
     <option value="second">Second</option>
     <option value="third">Third</option>
 </select>

$('#ddevents').change(function(){
   alert("selection had changed");
});