I want to add a class to an element depending on what browser they are using. This is what I have:
var browser = navigator.userAgent;
if (browser.match("Firefox")){
$(".dollar").addClass("ff");
}
But it doesn't seem to be working. What am I doing wrong?
Edit: The HTML
<p class="dollar">$</p>