Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用javascript将值转换为表单_Javascript_Html_Forms - Fatal编程技术网

使用javascript将值转换为表单

使用javascript将值转换为表单,javascript,html,forms,Javascript,Html,Forms,我正在使用基于xhtml的Wapka.mobi。我想把一个字符串从一个span转换成一个表单。这是我用过的 if(':user-prvar-625:'=='') { } else { document.getElementsByName("location")[0].innerHTML='From :user-prvar-625:';} 在这下面我有 function checkin(){ stat=document.getElementsByName("blog_b

我正在使用基于xhtml的Wapka.mobi。我想把一个字符串从一个span转换成一个表单。这是我用过的

 if(':user-prvar-625:'=='') {
 } else { 
   document.getElementsByName("location")[0].innerHTML='From :user-prvar-625:';}  
在这下面我有

function checkin(){ 
    stat=document.getElementsByName("blog_body")
    [0].value;loc=document.getElementsByName("loc")[0].value; if(':user-prvar-625:'=='') {} 
else {
    document.getElementsByName("blog_body")   
    [0].value=stat+'[checkin]'+loc+'[/checkin]';
   } 
}

stat和loc是跨度吗


使用
.innerHTML
而不是
.value

请把你的代码放在小提琴里,和我们分享。