How to get the text of a div which is not a part of any other container in JQuery?
- by Raja
This should be real easy. Given below is the HTML.
<div id='attachmentContainer'>
#Attachment#
<span id='spnAttachmentName' class='hidden'>#AttachmentName#</span>
<span id='spnAttachmentPath' class='hidden'>#AttachmentPath#</span>
</div>
I want to get just the #Attachment# and not the other text. When I tried
$("#attachmentContainer").text()
it gives out all #Attachment#, #AttachmentName# as well as #AttachmentPath#. I know I could just put #Attachment# into another span and access it directly but I was just intrigued on how to do this. Any help is much appreciated.