function bigger() {
var p = document.getElementById('image');
p.width++;
p.height++;
}我在onClick事件中调用这个js函数为什么id为image的图片没有改变大小
注意你的image对象必须存在style属性设置过width/height,要不下面的代码无效,dom.style.width获取不到样式表设置的值
function bigger() {
var p = document.getElementById('image');
p.style.width=(parseInt(p.style.width)||0)+'px;
p.style.height=(parseInt(p.style.height)||0)+'px;
这个不是对象不能这样操作的吧,你要通过css
$().css({属性:值});