JS 显示隐藏含有样式属性的图片


//展开
function showinfo()
{

document.getElementById("hidden1").removeAttribute('style');
document.getElementById("show1").removeAttribute('style');
document.getElementById("hidden1").setAttribute('style','cursor: pointer; display: none;');
document.getElementById("show1").setAttribute('style','cursor: pointer; display: inline-block;');

}

//隐藏
function hideInfo()
{
document.getElementById("hidden1").removeAttribute('style');
document.getElementById("show1").removeAttribute('style');
document.getElementById("hidden1").setAttribute('style','cursor: pointer; display: inline-block;');
document.getElementById("show1").setAttribute('style','cursor: pointer; display: none;');

}

你可能感兴趣的:(js)