From d1ee9c0cf200c09e717d40e27111f92b68772286 Mon Sep 17 00:00:00 2001 From: Tomas Kirda Date: Sat, 31 Aug 2013 16:21:16 -0500 Subject: [PATCH] Remove innerHTML usage. Fixes #93. --- src/jquery.autocomplete.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 2b4eba7..ea9380f 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -29,10 +29,12 @@ escapeRegExChars: function (value) { return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); }, - createNode: function (html) { + createNode: function (containerClass) { var div = document.createElement('div'); - div.innerHTML = html; - return div.firstChild; + div.className = containerClass; + div.style.position = 'absolute'; + div.style.display = 'none'; + return div; } }; }()), @@ -139,7 +141,7 @@ } }; - that.suggestionsContainer = Autocomplete.utils.createNode(''); + that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass); container = $(that.suggestionsContainer);