jsp and javascript
I'm developing a website. I had an idea to simplified the jsp content.
Simple example is like this
<html>
<script language="JavaScript" src="input.js">
</script>
<form>
<script>
addInput('email','text');
addInput('password','password');
</script>
<input type="submit">Submit</input>
</form>
</html>
while the content of the input.js is:
function addInput(name, type){
document.write(<input name="' + name + '" type="' + type + '"></input>);
}
My question is:
Are the idea safe to be implemented, are there any negative side of the idea?
can it run well in every browser?
thanks in advance

