2013-03-18 92 views
0

爲什麼不用這個代碼替換對象和嵌入?jQuery Replacewith(替換2個元素)

$(".watch-on-mobile").click(function() { 
$('object' && 'embed').replaceWith($('.video-js')); 
$('.video-js').css("display", "block") 
}); 

在此先感謝!

+2

爲什麼你認爲這工作...? – Matt 2013-03-18 17:48:45

回答

2

你不能發明一種語法,希望圖書館去猜測。

使用the multiple selector

$('object,embed').replaceWith($('.video-js'));