How to check whether an element with specific attribute value is present inside a div tag.
For example,
<div id='testdiv'>
<a dir='hello' href='#' ></a>
</div>
<input type='button' id='btn' />
Here is my Jquery.
$('#btn').click(function(){
if(/*Here I need the condition to check whether, `a` tag with attribute `dir` with value `hello` is present inside `div` */)
{
alert(present);
}
}
Please advice dear friends as I am beginner in jQuery. Thanks.