Skip to content
October 24, 2008 / kiranpatils

IE innerHTML – "Unknown runtime error"

Setting value of <div id=”divhtml”> using js like this :

document.getElementById(“divhtml”).innerHTML = “<form><input type=”text”>…</form>”;

it was giving me error..


oldDiv = document.getElementById(divhtml);
newDiv = document.createElement(oldDiv.tagName); =;
newDiv.className = oldDiv.className;
newDiv.innerHTML = “<form><input type=”text”>…</form>”;

oldDiv.parentNode.replaceChild(newDiv, oldDiv);

And it worked like a charm!!!!!!

Link :



Leave a Comment
  1. Leila / Feb 15 2010 12:51 pm

    Awesome solution.
    Well done and thank you 🙂

  2. I’m extremely impressed with your writing skills and also with the layout on your weblog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a nice blog like this one these days.

    • kiranpatils / May 6 2013 4:08 pm

      Thanks for the nice words!

      It’s default theme!

      Kiran Patil

  3. Cornelius / Jun 6 2013 10:29 pm

    Fine way of telling, and nice piece of writing to obtain facts on the topic of my presentation subject, which i am going to
    convey in college.

  4. Online Resorts Booking in Canada / Jun 11 2013 1:08 pm

    This design is spectacular! You certainly know how to keep a
    reader entertained. Between your wit and your videos,
    I was almost moved to start my own blog (well, almost…HaHa!
    ) Excellent job. I really enjoyed what you had to say, and more than that, how
    you presented it. Too cool!

  5. ipad 2 screen repair kl / Jun 13 2013 10:08 am

    Howdy! This post could not be written any better!
    Reading through this post reminds me of my previous room mate!
    He always kept talking about this. I will forward this article to him.
    Pretty sure he will have a good read. Many thanks for sharing!

  6. Wow that was strange. I just wrote an really
    long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again.
    Anyhow, just wanted to say great blog!

  7. Liquid web Hosting / Jul 7 2013 7:23 am

    You really make it seem so easy with your presentation but I find this topic to be really something that I think I would never understand.
    It seems too complex and very broad for me. I am looking forward for
    your next post, I’ll try to get the hang of it!

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 )

Google+ photo

You are commenting using your Google+ 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

%d bloggers like this: