Sadda-shutu Sadda-shutu - 7 months ago 11
HTML Question

How to find a class of text area under div using jQuery?

I am working with jQuery here. I have a div under I have one more div and I have a text area here I need to find a class of text area

My code:

<script type="text/javascript">
$(document).ready(function () {
alert('function fired');
$('.select').mouseleave( function () {
alert('will hide');
$('.select').hide();
});
});
</script>


and here my html div tag:

<div id="btndiv" style="height:373px;width:800px; border:10px solid orange ">
<div id="btndiv1" style="height:360px;width:800px; border: 1px solid orange ;">
<textarea rows="10" class="select" id="editor1"> </textarea>
</div>
</div>


I need to call a class of textarea. How could I do this? I had tried but still not working any help will be appreciated - thanks

Answer

You can do

$(this).attr('class');

/

var outside = $('#btndiv1 .select').attr('class') ;

    $('.select').mouseleave( function () {
           alert('will hide');
           $('.select').hide();
           var inside = $(this).attr('class') ;
     });