Hello – I’m trying to create a script that takes values from a form and creates XML tags. For example, if I submit “att:int” and “3” the following document.write should execute on the web page
But i’m having trouble passing the tag like characters (i.e. </). I tried using \, I tried storing </ in a variable but whenever I submit the form, that </ doesn’t allow the script to achieve the intended outcome. I’ve attached a stripped down version of the code below, can’t get “closeTag” to write. Does anyone have a handy trick for this type of output or is javascript not built for this? Thanks for your time!
<html>
<head>
<title>Loop</title>
</head>
<body>
<script language="javascript" type="text/javascript">
var openTag="<";
var endTag=">";
var closeTag="</";
for(var i=1;i <= 55; i++)
{
document.write(openTag + i + endTag);
document.write(openTag + i + endTag + '<br>');
}
Bookmarks