leaveGap function
I have to write Javascript for the following:
I need to seperate successive lines of input.
Instead of using document.write( '<BR><BR><BR>' ) I need to create a leaveGap function. eg leaveGap(2)
The function needs to be able to leave different line spaces throughout the programme eg 2 lines at one point in the programme and 1 line at another.
Any...
User Profile
Collapse
-
leaveGap function
I need to write Javascript for the following:
I need to seperate successive lines of input.
Instead of using document.write( '<BR><BR><BR>' ) I need to create a leaveGap function. eg leaveGap(2)
The function needs to be able to leave different line spaces throughout the programme eg 2 lines at one point in the programme and 1 line at another.
Any Ideas? -
euro
var euroRate
var response;
var amountInPounds, amountInEuros;
function twoDPs(anyNumbe r)
{
return Math.round (100 * anyNumber) / 100
};
function setEuroRate()
{
window.prompt(' What is the current Euro rate?','')
}
When the user inputs the current Euro rate how do I assign it to the variable? -
-
And again...
<HTML>
<HEAD>
<TITLE>Program_ TMA03
</TITLE>
<SCRIPT >
/* Program to read in a known number of data items and store them in an array */
var attendArray = new Array (5);
var dayArray = ['Monday','Tuesd ay','Wednesday' ,'Thursday','Fr iday']
document.write( 'Array program to read in a known number of data items');...Leave a comment:
-
Javascript program to prompt and accept input from user
I'm having huge difficulties producing a script for this:
Write a javascript programme that will prompt for, and accept from the user, an input string which contains at least 8 characters. It should then prompt for and accept a numerical value that is no greater than the length of the input string and should output a version of the input string which takes the form of a...Leave a comment:
-
<HTML>
<HEAD>
<TITLE>
Programme to accept no less than 8 characters
</TITLE>
<SCRIPT LANGUAGE = "JavaScript ">
function getStringInput( ){
myString = window.prompt(' Enter a Word with more than 8 Characters Please!','');
if(!myString){
return
}
if (myString.lengt h < 8)
{
alert("Please...Leave a comment:
-
Javascript program to prompt and accept input from user
I'm having huge difficulties producing a script for this:
Write a javascript programme that will prompt for, and accept from the user, an input string which contains at least 8 characters. It should then prompt for and accept a numerical value that is no greater than the length of the input string and should output a version of the input string which takes the form of a string of the same length as the input string but consisting entirely...
No activity results to display
Show More
Leave a comment: