You are here: Home | Forum | A bit more help if I may
You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.
Location: In A Politically Correct Hell!! Viva La Revolution
Age: 59
Services: 1gig Broadband
Posts: 864
ANOTHER question about JavaScript!!
Can anyone help? Below is my little JavaScript, my problem is I want the output to have astrix around it like so but cant remember how to do it..doh!
***********************************
The price of your ticket is
***********************************
This is my script............................................ .....................................
// to check the status of a prospective ticket purchaser
var age;
age = window.prompt('Please enter your age', '');
age = parseFloat(age);
while (age<5)
{
document.write ('You have made a mistake, please re-enter your age'+ '<BR>')
age = window.prompt('Please re-enter your age', '');
age = parseFloat(age);
}
if (age >59)
{
document.write
('The price of your ticket is a concessionary £8')
}
if (age <17)
{
document.write
('The price of your ticket is a concessionary £8')
}
else
{
document.write('The price of your ticket is £10')
}
document.write('********************************** *<br />The price of your ticket is £10<br />***********************************')
Location: In A Politically Correct Hell!! Viva La Revolution
Age: 59
Services: 1gig Broadband
Posts: 864
Re: ANOTHER question about JavaScript!!
Quote:
Originally Posted by Richard M
What's wrong with doing:
document.write('********************************** *<br />The price of your ticket is £10<br />***********************************')