Home  >  Article  >  Web Front-end  >  javascript export data to Excel (process elements in table)_javascript skills

javascript export data to Excel (process elements in table)_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:38:461092browse

Method:
Modify the outerHTML of Input;
Specific example:

Copy code The code is as follows:

function resetInput()
{
var controls = document.getElementsByTagName('input');
for(var i=0; iif (controls[i].type=='text')
{
if(controls[i].value =="")
{
controls[i].outerHTML=" " ;
}
else
{
controls[i].outerHTML=controls[i].value;
}
}
}
}

In this way, the Input can be modified and then exported to Excel. (You cannot modify everything in one cycle, just make some modifications according to the situation!)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn