Ecood05
04-26-2006, 06:50 PM
could anyone tell me an HTML tag to help me escape HTML within it?
i have my script for a online quiz and i cant seem to figure out how to turn off the html to allow "<>" to be used on the site. Below is the script i cannot figure out... I can get the "<>" in the script but i cannot get it to come out when i hit my check answer key since they are being acknowlaged as HTML code...
~~~~~~~~
questions=new Array();
//Follow the right answer with "right", all wrong ones with ""
questions[0]=["What does HTML stand for?", "Hyper Text Markup Language", "right", "Home Tool Markup Language", "", "Hyperlinks and Text Markup Language", "", "How To Make Love", ""]
questions[1]=["Who is making the Web standards?", "Microsoft", "", "Netscape", "", "The World Wide Web Consortium", "right", "Professor Ellerbruch", ""]
questions[2]=["Choose the correct HTML tag for the largest heading.", "<h1>", "right", "heading", "", "h6", "", "heading=h3", ""]
questions[3]=["What is the correct HTML tag for inserting a line break?", "br", "right", "lb", "", "break", "", "space=br", ""]
questions[4]=["What is the correct HTML for adding a background color?", "body bgcolor=blue", "right","body color=blue", "", "color=bluebody", ""]
questions[5]=["How can you make a list that lists the items with bullets?", "bullet=list", "", "list", "", "li", "", "ul", "right"]
questions[6]=["Choose the correct HTML tag to make a text bold.", "bb", "", "b", "right", "bld", "", "bold", ""][/COLOR]
questions[7]=["Choose the correct HTML tag to make a text italic.", "italics", "", "i", "right", "ii", "", "iss", ""]
questions[8]=["Which of these tags are all table tags?", "table, tr, tt", "", "table, head, tfoot", "", "table, tr, td", "right", "thead, body, tr", ""]
questions[9]=["What is the correct HTML for making a text input field?", "input type=textfield", "", "textinput type=text", "", "input type=textfield", "", "input type=text", "right"]
for (i = 0; i < questions.length; i++){
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all
function showAnswer(el,ans){
ie? ie[el].innerHTML='The correct answer is:'+ ans +': document.getElementById(el).innerHTML='The answer is: '+ ans
}
~~~~~~
~~The correct anser is: ???? + ans + ????? is what i cant figure out any input would be appreciated....
i have my script for a online quiz and i cant seem to figure out how to turn off the html to allow "<>" to be used on the site. Below is the script i cannot figure out... I can get the "<>" in the script but i cannot get it to come out when i hit my check answer key since they are being acknowlaged as HTML code...
~~~~~~~~
questions=new Array();
//Follow the right answer with "right", all wrong ones with ""
questions[0]=["What does HTML stand for?", "Hyper Text Markup Language", "right", "Home Tool Markup Language", "", "Hyperlinks and Text Markup Language", "", "How To Make Love", ""]
questions[1]=["Who is making the Web standards?", "Microsoft", "", "Netscape", "", "The World Wide Web Consortium", "right", "Professor Ellerbruch", ""]
questions[2]=["Choose the correct HTML tag for the largest heading.", "<h1>", "right", "heading", "", "h6", "", "heading=h3", ""]
questions[3]=["What is the correct HTML tag for inserting a line break?", "br", "right", "lb", "", "break", "", "space=br", ""]
questions[4]=["What is the correct HTML for adding a background color?", "body bgcolor=blue", "right","body color=blue", "", "color=bluebody", ""]
questions[5]=["How can you make a list that lists the items with bullets?", "bullet=list", "", "list", "", "li", "", "ul", "right"]
questions[6]=["Choose the correct HTML tag to make a text bold.", "bb", "", "b", "right", "bld", "", "bold", ""][/COLOR]
questions[7]=["Choose the correct HTML tag to make a text italic.", "italics", "", "i", "right", "ii", "", "iss", ""]
questions[8]=["Which of these tags are all table tags?", "table, tr, tt", "", "table, head, tfoot", "", "table, tr, td", "right", "thead, body, tr", ""]
questions[9]=["What is the correct HTML for making a text input field?", "input type=textfield", "", "textinput type=text", "", "input type=textfield", "", "input type=text", "right"]
for (i = 0; i < questions.length; i++){
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all
function showAnswer(el,ans){
ie? ie[el].innerHTML='The correct answer is:'+ ans +': document.getElementById(el).innerHTML='The answer is: '+ ans
}
~~~~~~
~~The correct anser is: ???? + ans + ????? is what i cant figure out any input would be appreciated....