Sharepoint and Javascript document.getElementById

I needed this today! While developing a custom web part for  Sharepoint 2013, I discovered there are some quirks when writing client-side javascript.

Instead of:


Use this:

document.getElementById(“<%=TextBox1.ClientID %>”);

It’s a bit of a pain to have to do this. But, it works.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s