From: dongsheng Date: Fri, 11 Sep 2009 02:17:54 +0000 (+0000) Subject: "MDL-16697, two js functions to destroy and show html element" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2538037f120d9f24bf06c33de94d99e0fa469b08;p=moodle.git "MDL-16697, two js functions to destroy and show html element" --- diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 7c8521ca69..7faa09c2a5 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -1094,6 +1094,19 @@ function hide_item(itemid) { } } +function show_item(itemid) { + var item = document.getElementById(itemid); + if (item) { + item.style.display = ""; + } +} + +function destroy_item(itemid) { + var item = document.getElementById(itemid); + if (item) { + item.parentNode.removeChild(item); + } +} /** * Tranfer keyboard focus to the HTML element with the given id, if it exists. * @param controlid the control id.