![]() |
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') } Thanks for any input |
Re: ANOTHER question about JavaScript!!
What's wrong with doing:
document.write('********************************** *<br />The price of your ticket is £10<br />***********************************') ? |
Re: ANOTHER question about JavaScript!!
Quote:
Blinding idea Thank you |
Re: ANOTHER question about JavaScript!!
Ahh, it doesn't work!! I hate coding!!!!!!!!!!!
|
Re: ANOTHER question about JavaScript!!
Try using the HTML Entity value. For a * it is:
* Put that anywhere in your HTML, and it would produce an asterix. Should work inside your document.write. HTH Edit: I forgot the entity automatically gets parsed into an astrisk :), sorry it is: [&][#][4][2][;] but without the [ and ]. All as one word. |
Re: ANOTHER question about JavaScript!!
I thought your question was a bit weird Womble, so I decided to test it, and:
document.write('*****************<br>'); works fine for me. You must have a problem elsewhere. Can you post the whole file for us? |
| All times are GMT. The time now is 18:48. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum