JavaScript hide/show element

前端 未结 11 1623
死守一世寂寞
死守一世寂寞 2020-11-22 00:08

How could I hide the \'Edit\'-link after I press it? and also can I hide the \"lorem ipsum\" text when I press edit?



        
11条回答
  •  遇见更好的自我
    2020-11-22 00:37

    function showStuff(id, text, btn) {
        document.getElementById(id).style.display = 'block';
        // hide the lorem ipsum text
        document.getElementById(text).style.display = 'none';
        // hide the link
        btn.style.display = 'none';
    }
    
    
    Edit
    
    
    Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum
    

提交回复
热议问题