javascript - Create a range or html fragment in IE from a string -


How can I get a string and with this I can make an html piece in IE. It works fine in non-browsers

  var str = "& lt; div> Foo "; Var range = document.createRange (); Var frag = range.createContextualFragment (str); Var e = document.getElementById ("element"); E.appendChild (frag);  

Would you like to consider using jQuery? Cross-browser compatible and easier to use:

  $ (document) .ready (function () {var str = "& lt; div> Foo  

and


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -