jQuery .clone() of audio tag with new ID not playing on IE or FF from inside a .click() -


jquery .clone() of audio tag new id not playing on ie or ff inside .click()

i have simple audio tag in body of page

<audio preload="auto" id="badclick"> <source src="audio/button-4.ogg"/> <source src="audio/button-4.mp3"/> <source src="audio/button-4.wav"/> <source src="audio/button-4.m4a"/> </audio> 

i use code clone , assign id 'badclick_1_1'

var gclk = 'badclick_1_1'; sounds[1] = $('#badclick');   $(sounds[1]).clone(true).attr('id', gclk).insertafter(sounds[1]); 

i try , play sound inside .click() handler although plays in chrome doesn't on ie , ff

var vol = .05; var xclk = 'badclick_1_1'; var audiobad = $('#' + xclk)[0]; audiobad.volume=vol; audiobad.play(); 

any thoughts why?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -