Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

geting the value of what is in a div tag from an id

return the value from an id


in my jquery code i am trying to do this

var IsNew = $("#init");

in my markup i am doing this

         <asp:TemplateField>
            <HeaderTemplate>init</HeaderTemplate>
            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="false" Width="40" />
            <ItemTemplate>
                <div style="margin-left: 2px;" id ="init" class="trimmed"><%# Eval("init")%></div>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="40" />
        </asp:TemplateField>



I want to get the value that is in the div where the cell is = init.

What am i doing wrong
ASKER CERTIFIED SOLUTION
Avatar of Chris
Chris
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did you check to see if once this is actually the id of the div once this scrip runs, with .net it often ends up with things that look like this id="ctl00_ContentPlaceHolder1_RadNotification1_XmlPanel" so make sure that your id is what it actually ends up with at runtime.
Also you could try using .html to find the contents within an element
http://api.jquery.com/html/
Avatar of vbnetcoder
vbnetcoder

ASKER

ty