FleextRoott
New Member
I am quite new in jQuery. I have a html code as below which is generated on the fly and added to my page:\[code\]<div class="outstandingcallback"><span>a</span><span>b</span></div><div class="outstandingcallback"><span>c</span><span>d</span></div> ......\[/code\]I need to hide one of them when I click on the other one.I used following jQuery but I am not sure how can I hide the div element.\[code\] $('.outstandingcallback').bind('click', function () { var selectdCallItemID = $(".callItemID", this).html(); var myHtmlCode = $('#CallBacks').html(); $('' + myHtmlCode + '').find('div').each(function () { var thisCallID = $(".callItemID", this).html(); if (thisCallID == selectdCallItemID ) { alert("test"); $('' + myHtmlCode + '').find(this).hide(); } }); });\[/code\]I am not sure about the following part:\[code\] $('' + myHtmlCode + '').find(this).hide();\[/code\]