Set Value of Input Using Javascript Function
document.getElementById('gadget_url').value = '';
Try... for YUI
Dom.get("gadget_url").set("value","");
with normal Javascript
document.getElementById('gadget_url').value = '';
with JQuery
$("#gadget_url").val("");
The following works in MVC5:
document.getElementById('theID').value = 'new value';