This question may be asked earlier. But I can not find the error. This is from the new Boston video tutorial.
$(document).ready(function(){ $('#btn').toggle(function(){ $('#msg').html('yes'); },function(){ $('#msg').html('No'); }); });
A video showing that when you click the text div first, yes , and the next time it shows no. But when I try, when the page loads, the fadeout button and div show no . What for? There may be other methods to achieve this functionality. But why is this not working. It shows the switch syntax as
$('#btn').toggle(function(){code},function{code});
javascript jquery html html5 toggle
Shameer Sep 15 '13 at 1:39 on 2013-09-15 01:39
source share