title: Set Value of Input Using Javascript Function
body: <p>I'm currently using a YUI gadget.  I also do have a Javascript function to validate the output that comes from the <code>div</code> that YUI draws for me:</p>
  
  <pre><code>Event.on("addGadgetUrl", "click", function(){
      var url = Dom.get("gadget_url").value;  /* line x ------&gt;*/
      if (url == "") {
          error.innerHTML = "&lt;p&gt; error" /&gt;&lt;/p&gt;";
      } else {
          /* line y ---&gt; */ 
          /*  I need to add some code in here to set the value of "gadget_url" by "" */
      }
  }, null, true);
  </code></pre>
  
  <p>Here is my <code>div</code>:</p>
  
  <pre><code>&lt;div&gt;
  &lt;p&gt;URL&lt;/p&gt;
  &lt;input type="text" name="gadget_url" id="gadget_url" style="width: 350px;" class="input"/&gt;
  &lt;input type="button" id="addGadgetUrl" value="add gadget"/&gt;
  &lt;br&gt;
  &lt;span id="error"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can see my question is, how can I set the value of <code>gadget_url</code> to be <code>""</code>?</p>