Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getElById: ElementRef = function(id) {
- return document.getElementById(id);
- }
- // ES 6:
- getElById = id: string => document.getElementById();
- getVisiblility = elem: ElementRef => elem.style.visibility;
- getDisplayProp = elem: ElementRef => elem.style.display;
- var visibility = getVisibility(getElById('someId'));
- isHidden = id: string => getVisibility(getElById('someId')) === 'hidden';
- isNotDisplayed = id: string => getDisplayProp(getElById('someId')) === 'none';
- if(isHidden(getElById(id))) {
- doSth()
- }
Add Comment
Please, Sign In to add comment