Friday, 23 August 2013

Hide element by class in pure javascript

Hide element by class in pure javascript

I have tried the following code, but it doesn't work. Any idea where I
have gone wrong?
Javascript
document.getElementsByClassName('appBanner').style.visibility='hidden';

HTML
<div class="appBanner">appbanner</div>


Just a side note, using jQuery or changing the HTML is not possible as I
am using [self->webView stringByEvaluatingJavaScriptFromString:@""]; in
Objective-C.

No comments:

Post a Comment