var element = document.getElementById('text');
document.getElementById("wedding").onclick = function(){
element.style.position = "absolute";
element.style.left = '-450px';
element.style.top = '-260px';
element.style.zoom = 0.8;
element.style.MozTransform = 'scale(0.8)';
element.style.WebkitTransform = 'scale(0.8)';
}
我需要将上面的代码用于两个按钮。所以我像下面这样更改此代码,但它不起作用。我怎样才能做到这一点。
var element = document.getElementById('text');
document.getElementById("wedding divorce").onclick = function(){
element.style.position = "absolute";
element.style.left = '-450px';
element.style.top = '-260px';
element.style.zoom = 0.8;
element.style.MozTransform = 'scale(0.8)';
element.style.WebkitTransform = 'scale(0.8)';
}