jQuery check if element exists

if ( $('.target').length > 0 ) {
	$('.log').text('.target element exist');
}

Leave a Reply

Your email address will not be published. Required fields are marked *