Hi Everyone, I need anyone who can to show me what I'm doing wrong and how to fix it.
I want the 5th character input into this page to display differently. Also, if anyone can tell me why firefox keeps working on the page like its incomplete, which it probably is, but why, I'd really appreciate it.
The code goes like this:
OR
The second one goes farther but not all the way, please help me out.
I want the 5th character input into this page to display differently. Also, if anyone can tell me why firefox keeps working on the page like its incomplete, which it probably is, but why, I'd really appreciate it.
The code goes like this:
Code:
<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var code=prompt("Please enter your code");
if ( code[4] = A ) { code[4] = S ; }
if ( code[4] = B ) { code[4] = M ; }
if ( code[4] = C ) { code[4] = I ; }
if ( code[4] = D ) { code[4] = L ; }
if ( code[4] = E ) { code[4] = E ; }
document.write(code);
document.write("<br />");
}
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="code" />
</body>
</html>
Code:
<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var code=prompt("Please enter your code");
if ( code[4] = 0 ) { code[4] = 9 ; }
if ( code[4] = 1 ) { code[4] = 8 ; }
if ( code[4] = 2 ) { code[4] = 7 ; }
if ( code[4] = 3 ) { code[4] = 6 ; }
if ( code[4] = 4 ) { code[4] = 5 ; }
document.write(code);
document.write("<br />");
}
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="code" />
</body>
</html>
The second one goes farther but not all the way, please help me out.