This does not work. Not sure what I am missing. Basically I want to toggle the none/block value in the style on the span class below based on the browser detection script.
Thanks in advance
var myBrowserVersion;
myBrowserVersion = parseInt(BrowserDetect.version);
//Detect if visitor is using Firefox 2 (less that version 3)
//If so just use a mailto method to send email.
//Otherwise use the abuse form
if (BrowserDetect.browser == "Firefox"){
//BrowserDetect.browser == "Firefox" && myBrowserVersion < 3
var badBrowser = getElementsByClassName("bad-Browser");
for(i = 0; i < badBrowser.length; i++) {
badBrowser.style.display = "none";
goodBrowser.style.display = "block";
}
}else {
var goodBrowser = getElementsByClassName("good-Browser");
for(i = 0; i < goodBrowser.length; i++) {
badBrowser.style.display = "block";
goodBrowser.style.display = "none";
}
}
<span class="abuse bad-Browser" style="display: none;"><a href="mailto:me@myemail.com?Subject=Report%20Comment%20Abuse:%20${cms.content.title}-${cms.content.id}&Body=Name:%20$util.encode.html($comment.name)%20Date:%20$comment.commentDate%20Comment:%20$util.encode.html($comment.comment)%20CommentID:%20$comment.commentID"class="timestamp">Report abuse</a></span>
<span class="abuse good-Browser" style="display: block;"><a href="javascript:showdiv('comment${comment.commentID}Menu');" class="timestamp">Report Abuse</a> </span>