View Single Post
Old 05-03-2011, 06:25 PM   #15 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

so when somebody clicks the #editmypictureclick it will hide or unhide the .editmypictures element based on if it is hidden or not. Right now your code only displays as block. Just put a condition if it is none change it to block, if not, the other way:

javascript Code:
document.getElementById('editmypicturesclick').onclick = function (e) {
    var delete_el = document.getElementByClassName('editmypictures');
    delete_el.style.display = (delete_el.style.display == 'none') ? 'block' : 'none';
};
notice that the actual name of the method is getElementByClassName not getElementByClass at least from mozilla docs.
tony is offline  
Reply With Quote