[Solved] How to add and remove classes in jq?

Finally i managed to solve this issue.. Actually i was using ‘prefix-free.js’ which was not correctly coded for chrome. Once i changed the browser and run that code on firefox, it worked perfectly. Due to that prefex-free.js i didn’t apply -webkit- or -moz-. Well Thanks all who participated.. EDITED: Sorry that prefix-free.js has nothing to … Read more

[Solved] jQuery methods on dynamic elements

You need to save $(this) after function() $(document).on(“click”,”.PlayPause”,function(){ var $this = $(this); //////Save this here////// if($(this).attr(‘src’) == ‘img/Play.png’){ $(this).attr(‘src’,’img/Pause.png’); var songId = $(this).parent().siblings(‘.Top_Container’).children(‘input’).val(); $.post(‘songs.php’,{songId : songId}, function(path){ //////////Use $this instead of $(this) inside here/////////// if(globalSong.playState && !($(this).hasClass(‘prevSelection’))){//$this $(‘.prevSelection’).attr(‘src’,’img/Play.png’); globalSong.pause(); $(‘.prevSelection’).removeClass(‘prevSelection’); } globalSong = soundManager.createSound({ id: (“sound” + songId), url: (songsPath + path), volume: userPrefVolume }); … Read more