html - value javascript function and dom -


i have function 1 window , takes value , passes on dom script , writes output screen on <div> or <p> or <a> , work well.

my point change dom element , put value on 1 text input. try call input id on function , write value innerhtml,but nor work well.

i not call function on input elements on other dom elements.

this code

 var vect = [];  function close(val) {   var elem = document.getelementbyid("output");        elem.innerhtml = "";   vect.length = 0;   (var in val.multiple) {     var d = val.multiple[i];     if (c) {       elem.innerhtml += c.print("%a, %y %b %d");                vect[vect.length] = c;     }   }   val.hide();   return true; } 

thanks

if want set value of input element, need use value, not innerhtml. should :

elem.value += c.print("%a, %y %b %d");  

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -