简体   繁体   中英

onValue doesn't fire

$('#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?

Hi you code work i did a test on codepen

#add 2 cdn jquery bacon

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

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");
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM