MontefuckeR
Registered
Значи искам да направя съвети т.е. при рефреш даден текст да се сменя с друг.Имаше един урок ама главата ми гръмна днеска и неможах да го намеря
Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<script>
var num_of_quotes = 3; //колко общо да са съветите
quotes = Math.floor (num_of_quotes * Math.random());
if (quotes==0) {
text="Съвет 1";
}
if (quotes==1) {
text="Съвет 2";
}
if (quotes==2) {
text="Съвет 3";
}
document.write('<div class="theQuote">');
document.write(''+ text +'');
document.write('</div>');
</script>
дадох ти точката но искам този див, да го използвам в друг документ... дано си ме разбралsvilkaa каза:<script>
var num_of_quotes = 3; //колко общо да са съветите
quotes = Math.floor (num_of_quotes * Math.random());
if (quotes==0) {
text="Съвет 1";
}
if (quotes==1) {
text="Съвет 2";
}
if (quotes==2) {
text="Съвет 3";
}
document.write('<div class="theQuote">');
document.write(''+ text +'');
document.write('</div>');
</script>
http://web-tourist.net/project/svilkaa/random-texts.html
<script>
var num_of_quotes = 3;
quotes = Math.floor (num_of_quotes * Math.random());
if (quotes==0) {
text="Съвет 1";
}
if (quotes==1) {
text="Съвет 2";
}
if (quotes==2) {
text="Съвет 3";
}
</script>
<div><script>document.write(''+ text +'');</script></div>