2013-03-18 113 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'));