Skip to content
Recommend our themes and earn 30% of our share of every sale you bring. Free to join.Earn by recommending our themes Become an affiliate

How to detect browser using jQuery?

Updated 14 Aug 2018

Source code

<script src="http://api.jquery.com/jQuery.browser/"></script>
<script>
	$(document).ready(function(){
		// Opera
		if ($.browser.opera) {
			$(".yourclass").remove();
		}

		// Webkit
		if ($.browser.webkit) {
			alert( "this is webkit!" );
		}

		// MSI
		if ($.browser.msie) {
			alert( "this is webkit!" );
		}

		// Mozila
		if ($.browser.mozilla) {
			alert( "this is webkit!" );
		}
	});
</script>

More code answers

Comments

Log in to leave a comment.