Setting up a couple of things with OneSignal sdk. Basically, I want the site to show a certain piece of content only to people who have subscribed to my notifications. Copied a piece of code from their tutorial section. Everything works fine, if only one action is required. As soon, as I add another, i breaks.
Here is the piece of code
OneSignal.isPushNotificationsEnabled(function(isEnabled) {
if (isEnabled)
document.getElementsByClassName('testsig')[0].style.display = 'block';
//as soon as I add following line, it stops working
document.getElementsByClassName('testhide')[0].style.display = 'none';
else
console.log("Push notifications are not enabled yet.");
});