I have this much javascript
<p>
<label style="top:16px" for="<%= ClientName.ClientID %>">Client Name</label>
<so:BoundSOTextBox autocomplete="off" runat="server" CssClass="stack radius" ID="ClientName" Width="98%" />
</p>
Now I want to get ClientName.ClientID element name in the string
So I am using …
NSString *retStr = [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"ClientName\");"];
I am using this code in webViewDidFinishLoad method
but i am not able to get it …
Can anyone tell me what to do here?
document.getElementById(\"Client Name\")should bedocument.getElementById(\"ClientName\")since you specifiedID="ClientName"I’m not sure what
<so:BoundSOTextBox>renders as HTML but I don’t think the DOM element supports.ClientName.ClientID. Anway as I said I don’t know what it renders exactly.update
to get the input’s value you should use
document.getElementById(\"ClientName\").valueif the rendered component is a<div> or <span> etc.you want need to useinnerHTMLinstead ofvalue.document.getElementById(\"ClientName\").innerHTML