Hi Nanda Kishore,
Please check this code snippet:
Add this script inside <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
function FindSpan()
{
var valueVariable = document.getElementById("DemoTextBox").value;
$('span[dnd-draggable]').each(function ()
{
if ($(this).attr("dnd-draggable").indexOf("{value:\'" + valueVariable + "\',") != -1)
{
alert($(this).attr('id'));
}
});
}
</script>
Add this controls inside <form>
<asp:TextBox runat="server" ID="DemoTextBox" />
<asp:Button runat="server" ID="demoButton" Text="Find" OnClientClick="javascript:return FindSpan();"/>
<span id="1" dnd-draggable={value:'a',text:'apple'}/>
<span id="2" dnd-draggable={value:'b',text:'bat'}/>
Please enter a or b inside textbox and then on click of button, you will get the exact span id.
Hope this will help you.
Regards,
Shashikant Gurav[Programmer II]
shashikantgurav22@gmail.com